]> git.sur5r.net Git - openldap/commitdiff
ITS#2464 don't strdup NULL DN
authorHoward Chu <hyc@openldap.org>
Fri, 25 Apr 2003 12:44:19 +0000 (12:44 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 25 Apr 2003 12:44:19 +0000 (12:44 +0000)
servers/slapd/slapi/slapi_ops.c

index 18b66e63b609c9892df7eec6134bac4cdbe335ff..9b19a485be9816d76baa7e408bd2db23b5f312b9 100644 (file)
@@ -1066,8 +1066,10 @@ slapi_search_internal_bind(
        ptr = (Slapi_PBlock *)op->o_pb;
        op->o_ctrls = controls;
 
-       dn.bv_val = slapi_ch_strdup(ldn);
-       dn.bv_len = strlen(ldn);
+       if ( ldn != NULL ) {
+               dn.bv_val = slapi_ch_strdup(ldn);
+               dn.bv_len = strlen(ldn);
+       }
 
        rs.sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, NULL );
        if ( rs.sr_err != LDAP_SUCCESS ) {