void
ldap_int_tls_destroy( struct ldapoptions *lo )
{
- SSL_CTX_free( lo->ldo_tls_ctx );
- lo->ldo_tls_ctx = NULL;
+ if ( lo->ldo_tls_ctx ) {
+ SSL_CTX_free( lo->ldo_tls_ctx );
+ lo->ldo_tls_ctx = NULL;
+ }
if ( lo->ldo_tls_certfile ) {
LDAP_FREE( lo->ldo_tls_certfile );
void
ldap_pvt_tls_destroy( void )
{
+ struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT();
+
+ ldap_int_tls_destroy( lo );
+
EVP_cleanup();
ERR_remove_state(0);
ERR_free_strings();