CTX_free(ctx);
   return res;</code></pre>

<p>To display errors we make use of the <a href="../man3/ERR_print_errors_fp.html">ERR_print_errors_fp(3)</a> function which simply dumps out the contents of any errors on the OpenSSL error stack to the specified location (in this case <i>stderr</i>).</p>

<p>We need to free up the <b>SSL</b> object that we created for the connection via the <a href="../man3/SSL_free.html">SSL_free(3)</a> function. Also, since we are not going to be creating any more TLS connectio