]> git.sur5r.net Git - openldap/commitdiff
Fix back-hdb test006 failures due to bad return code in hdb_dn2idl
authorHoward Chu <hyc@openldap.org>
Tue, 23 Sep 2003 08:16:23 +0000 (08:16 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 23 Sep 2003 08:16:23 +0000 (08:16 +0000)
servers/slapd/back-bdb/dn2id.c

index c3cef02e80d30311594fbb1952be28f90e7887e1..0dccf94bd5d01fdd5e1793d0ed8714a436d76e7e 100644 (file)
@@ -1016,6 +1016,7 @@ hdb_dn2idl_internal(
                /* The in-memory cache is in sync with the on-disk data.
                 * do we have any kids?
                 */
+               cx->rc = 0;
                if ( cx->ei->bei_ckids > 0 ) {
                        struct apply_arg ap;
 
@@ -1051,15 +1052,17 @@ saveit:
 gotit:
        if ( cx->rc == 0 ) {
                /* If eilist is NULL, cx->tmp is empty... */
-               if ( cx->prefix == DN_SUBTREE_PREFIX && eilist ) {
-                       bdb_idl_union( cx->ids, cx->tmp );
-                       for (ptr = eilist; *ptr; ptr++) {
-                               cx->ei = *ptr;
-                               cx->id = cx->ei->bei_id;
-                               hdb_dn2idl_internal( cx );
+               if ( cx->prefix == DN_SUBTREE_PREFIX ) {
+                       if ( eilist ) {
+                               bdb_idl_union( cx->ids, cx->tmp );
+                               for (ptr = eilist; *ptr; ptr++) {
+                                       cx->ei = *ptr;
+                                       cx->id = cx->ei->bei_id;
+                                       hdb_dn2idl_internal( cx );
+                               }
+                               cx->op->o_tmpfree( eilist, cx->op->o_tmpmemctx );
+                               cx->rc = 0;
                        }
-                       cx->op->o_tmpfree( eilist, cx->op->o_tmpmemctx );
-                       cx->rc = 0;
                } else {
                        BDB_IDL_CPY( cx->ids, cx->tmp );
                }