168651Skris=pod
268651Skris
368651Skris=head1 NAME
468651Skris
568651SkrisSSL_free - free an allocated SSL structure
668651Skris
768651Skris=head1 SYNOPSIS
868651Skris
968651Skris #include <openssl/ssl.h>
1068651Skris
1168651Skris void SSL_free(SSL *ssl);
1268651Skris
1368651Skris=head1 DESCRIPTION
1468651Skris
1568651SkrisSSL_free() decrements the reference count of B<ssl>, and removes the SSL
1668651Skrisstructure pointed to by B<ssl> and frees up the allocated memory if the
17194206Ssimonreference count has reached 0.
1868651Skris
1976866Skris=head1 NOTES
2076866Skris
2176866SkrisSSL_free() also calls the free()ing procedures for indirectly affected items, if
2268651Skrisapplicable: the buffering BIO, the read and write BIOs,
2368651Skriscipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
2468651SkrisDo not explicitly free these indirectly freed up items before or after
2568651Skriscalling SSL_free(), as trying to free things twice may lead to program
2668651Skrisfailure.
2768651Skris
2876866SkrisThe ssl session has reference counts from two users: the SSL object, for
2976866Skriswhich the reference count is removed by SSL_free() and the internal
3076866Skrissession cache. If the session is considered bad, because
3176866SkrisL<SSL_shutdown(3)|SSL_shutdown(3)> was not called for the connection
3276866Skrisand L<SSL_set_shutdown(3)|SSL_set_shutdown(3)> was not used to set the
3376866SkrisSSL_SENT_SHUTDOWN state, the session will also be removed
3476866Skrisfrom the session cache as required by RFC2246.
3576866Skris
3668651Skris=head1 RETURN VALUES
3768651Skris
3868651SkrisSSL_free() does not provide diagnostic information.
3968651Skris
4068651SkrisL<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
4176866SkrisL<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>,
4268651SkrisL<ssl(3)|ssl(3)>
4368651Skris
4468651Skris=cut
45