diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 8b918c8438..c208ef9e0e 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -188,6 +188,8 @@ ldap_pvt_tls_ctx_free ( void *c ) int refcount; tls_ctx *ctx = c; + if ( !ctx ) return; + #ifdef LDAP_R_COMPILE ldap_pvt_thread_mutex_lock( &ctx->ref_mutex ); #endif