From 99d2b7e7e9b95ae0f6601dcffd5554c16996dea5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 23 Sep 2003 08:16:23 +0000 Subject: [PATCH] Fix back-hdb test006 failures due to bad return code in hdb_dn2idl --- servers/slapd/back-bdb/dn2id.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index c3cef02e80..0dccf94bd5 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -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 ); } -- 2.39.5