1178171Simp=pod 2178171Simp 3178171Simp=head1 NAME 4178171Simp 5178171SimpSSL_free - free an allocated SSL structure 6178171Simp 7178171Simp=head1 SYNOPSIS 8178171Simp 9178171Simp #include <openssl/ssl.h> 10178171Simp 11178171Simp void SSL_free(SSL *ssl); 12178171Simp 13178171Simp=head1 DESCRIPTION 14178171Simp 15178171SimpSSL_free() decrements the reference count of B<ssl>, and removes the SSL 16178171Simpstructure pointed to by B<ssl> and frees up the allocated memory if the 17178171Simpreference count has reached 0. 18178171Simp 19178171Simp=head1 NOTES 20178171Simp 21178171SimpSSL_free() also calls the free()ing procedures for indirectly affected items, if 22178171Simpapplicable: the buffering BIO, the read and write BIOs, 23178171Simpcipher lists specially created for this B<ssl>, the B<SSL_SESSION>. 24178171SimpDo not explicitly free these indirectly freed up items before or after 25178171Simpcalling SSL_free(), as trying to free things twice may lead to program 26178171Simpfailure. 27178171Simp 28302190SlandonfThe ssl session has reference counts from two users: the SSL object, for 29302190Slandonfwhich the reference count is removed by SSL_free() and the internal 30178171Simpsession cache. If the session is considered bad, because 31178171SimpL<SSL_shutdown(3)|SSL_shutdown(3)> was not called for the connection 32302190Slandonfand L<SSL_set_shutdown(3)|SSL_set_shutdown(3)> was not used to set the 33178171SimpSSL_SENT_SHUTDOWN state, the session will also be removed 34178171Simpfrom the session cache as required by RFC2246. 35263301Simp 36263301Simp=head1 RETURN VALUES 37263301Simp 38178171SimpSSL_free() does not provide diagnostic information. 39178171Simp 40178171SimpL<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>, 41178171SimpL<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>, 42263301SimpL<ssl(3)|ssl(3)> 43263301Simp 44178171Simp=cut 45263301Simp