From: Howard Chu Date: Sat, 21 May 2022 15:39:29 +0000 (+0100) Subject: ITS#9157: check for NULL ld X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b78166a47e69125e5d95f33365bb08a987c200c;p=thirdparty%2Fopenldap.git ITS#9157: check for NULL ld --- diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c index 6d36db1984..dff845bc10 100644 --- a/libraries/libldap/tls2.c +++ b/libraries/libldap/tls2.c @@ -989,7 +989,7 @@ ldap_pvt_tls_set_option( LDAP *ld, int option, void *arg ) lo->ldo_tls_ctx = NULL; errmsg[0] = 0; rc = ldap_int_tls_init_ctx( lo, *(int *)arg, errmsg ); - if ( rc && errmsg[0] ) { + if ( rc && errmsg[0] && ld ) { if ( ld->ld_error ) LDAP_FREE( ld->ld_error ); ld->ld_error = LDAP_STRDUP( errmsg );