xref: /minix3/crypto/external/bsd/openssl/dist/doc/ssl/SSL_free.pod (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc=pod
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel Sambuc=head1 NAME
4*ebfedea0SLionel Sambuc
5*ebfedea0SLionel SambucSSL_free - free an allocated SSL structure
6*ebfedea0SLionel Sambuc
7*ebfedea0SLionel Sambuc=head1 SYNOPSIS
8*ebfedea0SLionel Sambuc
9*ebfedea0SLionel Sambuc #include <openssl/ssl.h>
10*ebfedea0SLionel Sambuc
11*ebfedea0SLionel Sambuc void SSL_free(SSL *ssl);
12*ebfedea0SLionel Sambuc
13*ebfedea0SLionel Sambuc=head1 DESCRIPTION
14*ebfedea0SLionel Sambuc
15*ebfedea0SLionel SambucSSL_free() decrements the reference count of B<ssl>, and removes the SSL
16*ebfedea0SLionel Sambucstructure pointed to by B<ssl> and frees up the allocated memory if the
17*ebfedea0SLionel Sambucreference count has reached 0.
18*ebfedea0SLionel Sambuc
19*ebfedea0SLionel Sambuc=head1 NOTES
20*ebfedea0SLionel Sambuc
21*ebfedea0SLionel SambucSSL_free() also calls the free()ing procedures for indirectly affected items, if
22*ebfedea0SLionel Sambucapplicable: the buffering BIO, the read and write BIOs,
23*ebfedea0SLionel Sambuccipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
24*ebfedea0SLionel SambucDo not explicitly free these indirectly freed up items before or after
25*ebfedea0SLionel Sambuccalling SSL_free(), as trying to free things twice may lead to program
26*ebfedea0SLionel Sambucfailure.
27*ebfedea0SLionel Sambuc
28*ebfedea0SLionel SambucThe ssl session has reference counts from two users: the SSL object, for
29*ebfedea0SLionel Sambucwhich the reference count is removed by SSL_free() and the internal
30*ebfedea0SLionel Sambucsession cache. If the session is considered bad, because
31*ebfedea0SLionel SambucL<SSL_shutdown(3)|SSL_shutdown(3)> was not called for the connection
32*ebfedea0SLionel Sambucand L<SSL_set_shutdown(3)|SSL_set_shutdown(3)> was not used to set the
33*ebfedea0SLionel SambucSSL_SENT_SHUTDOWN state, the session will also be removed
34*ebfedea0SLionel Sambucfrom the session cache as required by RFC2246.
35*ebfedea0SLionel Sambuc
36*ebfedea0SLionel Sambuc=head1 RETURN VALUES
37*ebfedea0SLionel Sambuc
38*ebfedea0SLionel SambucSSL_free() does not provide diagnostic information.
39*ebfedea0SLionel Sambuc
40*ebfedea0SLionel SambucL<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
41*ebfedea0SLionel SambucL<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>,
42*ebfedea0SLionel SambucL<ssl(3)|ssl(3)>
43*ebfedea0SLionel Sambuc
44*ebfedea0SLionel Sambuc=cut
45