SSL_free.pod revision 76867
1221828Sgrehan=pod
2221828Sgrehan
3221828Sgrehan=head1 NAME
4221828Sgrehan
5221828SgrehanSSL_free - free an allocated SSL structure
6221828Sgrehan
7221828Sgrehan=head1 SYNOPSIS
8221828Sgrehan
9221828Sgrehan #include <openssl/ssl.h>
10221828Sgrehan
11221828Sgrehan void SSL_free(SSL *ssl);
12221828Sgrehan
13221828Sgrehan=head1 DESCRIPTION
14221828Sgrehan
15221828SgrehanSSL_free() decrements the reference count of B<ssl>, and removes the SSL
16221828Sgrehanstructure pointed to by B<ssl> and frees up the allocated memory if the
17221828Sgrehanthe reference count has reached 0.
18221828Sgrehan
19221828Sgrehan=head1 NOTES
20221828Sgrehan
21221828SgrehanSSL_free() also calls the free()ing procedures for indirectly affected items, if
22221828Sgrehanapplicable: the buffering BIO, the read and write BIOs,
23221828Sgrehancipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
24221828SgrehanDo not explicitly free these indirectly freed up items before or after
25221828Sgrehancalling SSL_free(), as trying to free things twice may lead to program
26221828Sgrehanfailure.
27221828Sgrehan
28221828SgrehanThe ssl session has reference counts from two users: the SSL object, for
29221828Sgrehanwhich the reference count is removed by SSL_free() and the internal
30221828Sgrehansession cache. If the session is considered bad, because
31221828SgrehanL<SSL_shutdown(3)|SSL_shutdown(3)> was not called for the connection
32221828Sgrehanand L<SSL_set_shutdown(3)|SSL_set_shutdown(3)> was not used to set the
33221828SgrehanSSL_SENT_SHUTDOWN state, the session will also be removed
34221828Sgrehanfrom the session cache as required by RFC2246.
35221828Sgrehan
36221828Sgrehan=head1 RETURN VALUES
37222105Sgrehan
38243325SgrehanSSL_free() does not provide diagnostic information.
39221828Sgrehan
40221828SgrehanL<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
41255287SgrehanL<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>,
42221828SgrehanL<ssl(3)|ssl(3)>
43221828Sgrehan
44221828Sgrehan=cut
45221828Sgrehan