113d40330Schristos=pod 213d40330Schristos 313d40330Schristos=head1 NAME 413d40330Schristos 513d40330SchristosSSL_free - free an allocated SSL structure 613d40330Schristos 713d40330Schristos=head1 SYNOPSIS 813d40330Schristos 913d40330Schristos #include <openssl/ssl.h> 1013d40330Schristos 1113d40330Schristos void SSL_free(SSL *ssl); 1213d40330Schristos 1313d40330Schristos=head1 DESCRIPTION 1413d40330Schristos 1513d40330SchristosSSL_free() decrements the reference count of B<ssl>, and removes the SSL 1613d40330Schristosstructure pointed to by B<ssl> and frees up the allocated memory if the 1713d40330Schristosreference count has reached 0. 1813d40330SchristosIf B<ssl> is NULL nothing is done. 1913d40330Schristos 2013d40330Schristos=head1 NOTES 2113d40330Schristos 2213d40330SchristosSSL_free() also calls the free()ing procedures for indirectly affected items, if 2313d40330Schristosapplicable: the buffering BIO, the read and write BIOs, 2413d40330Schristoscipher lists specially created for this B<ssl>, the B<SSL_SESSION>. 2513d40330SchristosDo not explicitly free these indirectly freed up items before or after 2613d40330Schristoscalling SSL_free(), as trying to free things twice may lead to program 2713d40330Schristosfailure. 2813d40330Schristos 2913d40330SchristosThe ssl session has reference counts from two users: the SSL object, for 3013d40330Schristoswhich the reference count is removed by SSL_free() and the internal 3113d40330Schristossession cache. If the session is considered bad, because 3213d40330SchristosL<SSL_shutdown(3)> was not called for the connection 3313d40330Schristosand L<SSL_set_shutdown(3)> was not used to set the 3413d40330SchristosSSL_SENT_SHUTDOWN state, the session will also be removed 3513d40330Schristosfrom the session cache as required by RFC2246. 3613d40330Schristos 3713d40330Schristos=head1 RETURN VALUES 3813d40330Schristos 3913d40330SchristosSSL_free() does not provide diagnostic information. 4013d40330Schristos 4113d40330SchristosL<SSL_new(3)>, L<SSL_clear(3)>, 4213d40330SchristosL<SSL_shutdown(3)>, L<SSL_set_shutdown(3)>, 4313d40330SchristosL<ssl(7)> 4413d40330Schristos 4513d40330Schristos=head1 COPYRIGHT 4613d40330Schristos 4713d40330SchristosCopyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. 4813d40330Schristos 49*b0d17251SchristosLicensed under the Apache License 2.0 (the "License"). You may not use 5013d40330Schristosthis file except in compliance with the License. You can obtain a copy 5113d40330Schristosin the file LICENSE in the source distribution or at 5213d40330SchristosL<https://www.openssl.org/source/license.html>. 5313d40330Schristos 5413d40330Schristos=cut 55