]> git.sur5r.net Git - openldap/commitdiff
ITS#2974 fix from HEAD
authorHoward Chu <hyc@openldap.org>
Tue, 2 Mar 2004 23:14:25 +0000 (23:14 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 2 Mar 2004 23:14:25 +0000 (23:14 +0000)
servers/slapd/back-bdb/tools.c

index 7e3789af1a24832c9a12947cc4282d18ec40d6b2..3d98aca1b111204b091092593c384a8fc3230a4d 100644 (file)
@@ -148,6 +148,7 @@ int bdb_tool_next_id(
                        dnParent( &dn, &pdn );
                        e->e_nname = pdn;
                        rc = bdb_tool_next_id( be, tid, e, text, 1 );
+                       e->e_nname = dn;
                        if ( rc ) {
                                return rc;
                        }
@@ -166,7 +167,6 @@ int bdb_tool_next_id(
 #endif
                        return rc;
                }
-               e->e_nname = dn;
                rc = bdb_dn2id_add( be, tid, &pdn, e );
                if ( rc ) {
                        snprintf( text->bv_val, text->bv_len, 
@@ -182,10 +182,10 @@ int bdb_tool_next_id(
                } else if ( hole ) {
                        if ( nholes == nhmax - 1 ) {
                                if ( holes == hbuf ) {
-                                       holes = ch_malloc( nhmax * sizeof(ID) * 2 );
+                                       holes = ch_malloc( nhmax * sizeof(dn_id) * 2 );
                                        AC_MEMCPY( holes, hbuf, sizeof(hbuf) );
                                } else {
-                                       holes = ch_realloc( holes, nhmax * sizeof(ID) * 2 );
+                                       holes = ch_realloc( holes, nhmax * sizeof(dn_id) * 2 );
                                }
                                nhmax *= 2;
                        }