xref: /onnv-gate/usr/src/common/openssl/doc/ssl/SSL_free.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948SSL_free - free an allocated SSL structure
6*2175Sjp161948
7*2175Sjp161948=head1 SYNOPSIS
8*2175Sjp161948
9*2175Sjp161948 #include <openssl/ssl.h>
10*2175Sjp161948
11*2175Sjp161948 void SSL_free(SSL *ssl);
12*2175Sjp161948
13*2175Sjp161948=head1 DESCRIPTION
14*2175Sjp161948
15*2175Sjp161948SSL_free() decrements the reference count of B<ssl>, and removes the SSL
16*2175Sjp161948structure pointed to by B<ssl> and frees up the allocated memory if the
17*2175Sjp161948the reference count has reached 0.
18*2175Sjp161948
19*2175Sjp161948=head1 NOTES
20*2175Sjp161948
21*2175Sjp161948SSL_free() also calls the free()ing procedures for indirectly affected items, if
22*2175Sjp161948applicable: the buffering BIO, the read and write BIOs,
23*2175Sjp161948cipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
24*2175Sjp161948Do not explicitly free these indirectly freed up items before or after
25*2175Sjp161948calling SSL_free(), as trying to free things twice may lead to program
26*2175Sjp161948failure.
27*2175Sjp161948
28*2175Sjp161948The ssl session has reference counts from two users: the SSL object, for
29*2175Sjp161948which the reference count is removed by SSL_free() and the internal
30*2175Sjp161948session cache. If the session is considered bad, because
31*2175Sjp161948L<SSL_shutdown(3)|SSL_shutdown(3)> was not called for the connection
32*2175Sjp161948and L<SSL_set_shutdown(3)|SSL_set_shutdown(3)> was not used to set the
33*2175Sjp161948SSL_SENT_SHUTDOWN state, the session will also be removed
34*2175Sjp161948from the session cache as required by RFC2246.
35*2175Sjp161948
36*2175Sjp161948=head1 RETURN VALUES
37*2175Sjp161948
38*2175Sjp161948SSL_free() does not provide diagnostic information.
39*2175Sjp161948
40*2175Sjp161948L<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
41*2175Sjp161948L<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>,
42*2175Sjp161948L<ssl(3)|ssl(3)>
43*2175Sjp161948
44*2175Sjp161948=cut
45