summaryrefslogtreecommitdiff
path: root/lib/libssl/doc/SSL_free.3
blob: 1a3711e6c7b03b8c6abca5d11f6b53970d7494f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.\"
.\"	$OpenBSD: SSL_free.3,v 1.3 2015/12/30 18:45:02 millert Exp $
.\"
.Dd $Mdocdate: December 30 2015 $
.Dt SSL_FREE 3
.Os
.Sh NAME
.Nm SSL_free
.Nd free an allocated SSL structure
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft void
.Fn SSL_free "SSL *ssl"
.Sh DESCRIPTION
.Fn SSL_free
decrements the reference count of
.Fa ssl ,
and removes the
.Vt SSL
structure pointed to by
.Fa ssl
and frees up the allocated memory if the reference count has reached 0.
If
.Fa ssl
is a
.Dv NULL
pointer, no action occurs.
.Sh NOTES
.Fn SSL_free
also calls the
.Xr free 3 Ns
ing procedures for indirectly affected items, if applicable: the buffering
.Vt BIO ,
the read and write
.Vt BIOs ,
cipher lists specially created for this
.Fa ssl ,
the
.Sy SSL_SESSION .
Do not explicitly free these indirectly freed up items before or after calling
.Fn SSL_free ,
as trying to free things twice may lead to program failure.
.Pp
The
.Fa ssl
session has reference counts from two users: the
.Vt SSL
object, for which the reference count is removed by
.Fn SSL_free
and the internal session cache.
If the session is considered bad, because
.Xr SSL_shutdown 3
was not called for the connection and
.Xr SSL_set_shutdown 3
was not used to set the
.Vt SSL_SENT_SHUTDOWN
state, the session will also be removed from the session cache as required by
RFC2246.
.Sh RETURN VALUES
.Fn SSL_free
does not provide diagnostic information.
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_clear 3 ,
.Xr SSL_new 3 ,
.Xr SSL_set_shutdown 3 ,
.Xr SSL_shutdown 3