]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/ssl/SSL_free.pod
The wrong ifdef is used to guard usage of PSK code
[thirdparty/openssl.git] / doc / ssl / SSL_free.pod
CommitLineData
cc99526d
RL
1=pod
2
3=head1 NAME
4
1e4e5492 5SSL_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
15SSL_free() decrements the reference count of B<ssl>, and removes the SSL
16structure pointed to by B<ssl> and frees up the allocated memory if the
477fd459 17reference count has reached 0.
cc99526d 18
8e495e4a
LJ
19=head1 NOTES
20
21SSL_free() also calls the free()ing procedures for indirectly affected items, if
cc99526d 22applicable: the buffering BIO, the read and write BIOs,
1e4e5492 23cipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
cc99526d
RL
24Do not explicitly free these indirectly freed up items before or after
25calling SSL_free(), as trying to free things twice may lead to program
26failure.
27
8e495e4a
LJ
28The ssl session has reference counts from two users: the SSL object, for
29which the reference count is removed by SSL_free() and the internal
30session cache. If the session is considered bad, because
31L<SSL_shutdown(3)|SSL_shutdown(3)> was not called for the connection
32and L<SSL_set_shutdown(3)|SSL_set_shutdown(3)> was not used to set the
33SSL_SENT_SHUTDOWN state, the session will also be removed
34from the session cache as required by RFC2246.
35
cc99526d
RL
36=head1 RETURN VALUES
37
38SSL_free() does not provide diagnostic information.
39
40L<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
8e495e4a 41L<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>,
cc99526d
RL
42L<ssl(3)|ssl(3)>
43
44=cut