]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9157: check for NULL ld
authorHoward Chu <hyc@openldap.org>
Sat, 21 May 2022 15:39:29 +0000 (16:39 +0100)
committerHoward Chu <hyc@openldap.org>
Sat, 21 May 2022 15:39:29 +0000 (16:39 +0100)
libraries/libldap/tls2.c

index 6d36db1984f82d9e04213119a79df2bf66674b96..dff845bc10a1c08acb1f6ca7e26188ced305babb 100644 (file)
@@ -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 );