SSL_SESSION_free 3 2002-06-09 0.9.9-dev OpenSSL
NAME
SSL_SESSION_free - free an allocated SSL_SESSION structure
LIBRARY
libcrypto, -lcrypto
SYNOPSIS
#include
void SSL_SESSION_free(SSL_SESSION *session);
DESCRIPTION
_S_S_L___S_E_S_S_I_O_N___f_r_e_e_(_) decrements the reference count of sseessssiioonn and removes
the SSSSLL__SSEESSSSIIOONN structure pointed to by sseessssiioonn and frees up the allocated
memory, if the the reference count has reached 0.
NOTES
SSL_SESSION objects are allocated, when a TLS/SSL handshake operation
is successfully completed. Depending on the settings, see
_S_S_L___C_T_X___s_e_t___s_e_s_s_i_o_n___c_a_c_h_e___m_o_d_e(3),
the SSL_SESSION objects are internally referenced by the SSL_CTX and
linked into its session cache. SSL objects may be using the SSL_SESSION object;
as a session may be reused, several SSL objects may be using one SSL_SESSION
object at the same time. It is therefore crucial to keep the reference
count (usage information) correct and not delete a SSL_SESSION object
that is still used, as this may lead to program failures due to
dangling pointers. These failures may also appear delayed, e.g.
when an SSL_SESSION object was completely freed as the reference count
incorrectly became 0, but it is still referenced in the internal
session cache and the cache list is processed during a
_S_S_L___C_T_X___f_l_u_s_h___s_e_s_s_i_o_n_s(3) operation.
_S_S_L___S_E_S_S_I_O_N___f_r_e_e_(_) must only be called for SSL_SESSION objects, for
which the reference count was explicitly incremented (e.g.
by calling _S_S_L___g_e_t_1___s_e_s_s_i_o_n_(_), see _S_S_L___g_e_t___s_e_s_s_i_o_n(3))
or when the SSL_SESSION object was generated outside a TLS handshake
operation, e.g. by using _d_2_i___S_S_L___S_E_S_S_I_O_N(3).
It must not be called on other SSL_SESSION objects, as this would cause
incorrect reference counts and therefore program failures.
RETURN VALUES
_S_S_L___S_E_S_S_I_O_N___f_r_e_e_(_) does not provide diagnostic information.
SEE ALSO
_s_s_l(3), _S_S_L___g_e_t___s_e_s_s_i_o_n(3),
_S_S_L___C_T_X___s_e_t___s_e_s_s_i_o_n___c_a_c_h_e___m_o_d_e(3),
_S_S_L___C_T_X___f_l_u_s_h___s_e_s_s_i_o_n_s(3),
_d_2_i___S_S_L___S_E_S_S_I_O_N(3)