1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos SSL_free - free an allocated SSL structure 6 1.1 christos 7 1.1 christos =head1 SYNOPSIS 8 1.1 christos 9 1.1 christos #include <openssl/ssl.h> 10 1.1 christos 11 1.1 christos void SSL_free(SSL *ssl); 12 1.1 christos 13 1.1 christos =head1 DESCRIPTION 14 1.1 christos 15 1.1 christos SSL_free() decrements the reference count of B<ssl>, and removes the SSL 16 1.1 christos structure pointed to by B<ssl> and frees up the allocated memory if the 17 1.1 christos reference count has reached 0. 18 1.1 christos If B<ssl> is NULL nothing is done. 19 1.1 christos 20 1.1 christos =head1 NOTES 21 1.1 christos 22 1.1 christos SSL_free() also calls the free()ing procedures for indirectly affected items, if 23 1.1 christos applicable: the buffering BIO, the read and write BIOs, 24 1.1 christos cipher lists specially created for this B<ssl>, the B<SSL_SESSION>. 25 1.1 christos Do not explicitly free these indirectly freed up items before or after 26 1.1 christos calling SSL_free(), as trying to free things twice may lead to program 27 1.1 christos failure. 28 1.1 christos 29 1.1 christos The ssl session has reference counts from two users: the SSL object, for 30 1.1 christos which the reference count is removed by SSL_free() and the internal 31 1.1 christos session cache. If the session is considered bad, because 32 1.1 christos L<SSL_shutdown(3)> was not called for the connection 33 1.1 christos and L<SSL_set_shutdown(3)> was not used to set the 34 1.1 christos SSL_SENT_SHUTDOWN state, the session will also be removed 35 1.1 christos from the session cache as required by RFC2246. 36 1.1 christos 37 1.1 christos =head1 RETURN VALUES 38 1.1 christos 39 1.1 christos SSL_free() does not provide diagnostic information. 40 1.1 christos 41 1.1 christos L<SSL_new(3)>, L<SSL_clear(3)>, 42 1.1 christos L<SSL_shutdown(3)>, L<SSL_set_shutdown(3)>, 43 1.1 christos L<ssl(7)> 44 1.1 christos 45 1.1 christos =head1 COPYRIGHT 46 1.1 christos 47 1.1 christos Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. 48 1.1 christos 49 1.1.1.2 christos Licensed under the Apache License 2.0 (the "License"). You may not use 50 1.1 christos this file except in compliance with the License. You can obtain a copy 51 1.1 christos in the file LICENSE in the source distribution or at 52 1.1 christos L<https://www.openssl.org/source/license.html>. 53 1.1 christos 54 1.1 christos =cut 55