From 7bea24076725726da366f38f25f4c9bb014dd803 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 21 Aug 2007 15:19:01 +0000 Subject: [PATCH] fix tree delete error handling --- servers/slapd/back-sql/search.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index e293151dea..2922d47ccc 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -2452,13 +2452,15 @@ next_entry2:; } end_of_search:; - if ( rs->sr_nentries > 0 ) { - rs->sr_ref = rs->sr_v2ref; - rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS - : LDAP_REFERRAL; - - } else { - rs->sr_err = bsi.bsi_status; + if ( rs->sr_err == LDAP_SUCCESS ) { + if ( rs->sr_nentries > 0 ) { + rs->sr_ref = rs->sr_v2ref; + rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS + : LDAP_REFERRAL; + + } else { + rs->sr_err = bsi.bsi_status; + } } send_results:; -- 2.39.5