From: Howard Chu Date: Fri, 7 Apr 2006 02:41:58 +0000 (+0000) Subject: Fix destruct sequencing X-Git-Tag: OPENLDAP_REL_ENG_2_4_0ALPHA~16 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=571ac24b3367d8a6ee3397c88250ae71e242941b;p=openldap Fix destruct sequencing --- diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 96e57ef951..504263ed14 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -111,8 +111,10 @@ static void tls_init_threads( void ) 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 ); @@ -146,6 +148,10 @@ ldap_int_tls_destroy( struct ldapoptions *lo ) 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();