
#use wml::openssl-macros area=docs page=SSL_free

<title>Documents, SSL_free(3)</title>

<h1>SSL_free(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_free - free an allocated SSL structure

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> void SSL_free(SSL *ssl);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_free()</CODE> decrements the reference count of <STRONG>ssl</STRONG>, and removes the SSL structure pointed to by <STRONG>ssl</STRONG> and frees up the allocated memory if the the reference count has reached 0.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
<CODE>SSL_free()</CODE> also calls the <CODE>free()ing</CODE> procedures
for indirectly affected items, if applicable: the buffering BIO, the read
and write BIOs, cipher lists specially created for this <STRONG>ssl</STRONG>, the <STRONG>SSL_SESSION</STRONG>. Do not explicitly free these indirectly freed up items before or after
calling <CODE>SSL_free(),</CODE> as trying to free things twice may lead to
program failure.

</P>
<P>
The ssl session has reference counts from two users: the SSL object, for
which the reference count is removed by <CODE>SSL_free()</CODE> and the
internal session cache. If the session is considered bad, because
<A HREF="../ssl/SSL_shutdown.html#">SSL_shutdown(3)</A> was not called for the connection and <A HREF="../ssl/SSL_set_shutdown.html#">SSL_set_shutdown(3)</A> was not used to set the SSL_SENT_SHUTDOWN state, the session will also be
removed from the session cache as required by RFC2246.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>SSL_free()</CODE> does not provide diagnostic information.

</P>
<P>
<A HREF="../ssl/SSL_new.html#">SSL_new(3)</A>, <A HREF="../ssl/SSL_clear.html#">SSL_clear(3)</A>,
<A HREF="../ssl/SSL_shutdown.html#">SSL_shutdown(3)</A>, <A HREF="../ssl/SSL_set_shutdown.html#">SSL_set_shutdown(3)</A>,
<A HREF="../ssl/ssl.html#">ssl(3)</A>



</P>
:}

