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