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