]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/add.c
modify be_referral to use struct berval DNs.
[openldap] / servers / slapd / back-ldbm / add.c
index f02429ba26b6c547d50e5242810c65bf2d005d9d..1b86663a2388e25055db7700ecbe4d19ff32f608 100644 (file)
@@ -123,15 +123,12 @@ ldbm_back_add(
                        ber_bvecfree( refs );
                        free( matched_dn );
 
-                       free( pdn );
                        return -1;
                }
 
                /* don't need the add lock anymore */
                ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
 
-               free(pdn);
-
                if ( ! access_allowed( be, conn, op, p,
                        children, NULL, ACL_WRITE ) )
                {
@@ -205,15 +202,12 @@ ldbm_back_add(
        } else {
                if(pdn != NULL) {
                        assert( *pdn == '\0' );
-                       free(pdn);
                }
 
                /* no parent, must be adding entry to root */
-               if ( !be_isroot( be, op->o_ndn ) ) {
-                       if ( be_issuffix( be, "" ) 
-                                       || be_isupdate( be, op->o_ndn ) ) {
-                               static const Entry rootp = { NOID, "", "", NULL, NULL };
-                               p = (Entry *)&rootp;
+               if ( !be_isroot( be, &op->o_ndn ) ) {
+                       if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
+                               p = (Entry *)&slap_entry_root;
                                
                                rc = access_allowed( be, conn, op, p,
                                        children, NULL, ACL_WRITE );