From: Pierangelo Masarati Date: Tue, 21 Aug 2007 15:19:01 +0000 (+0000) Subject: fix tree delete error handling X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~155 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7bea24076725726da366f38f25f4c9bb014dd803;p=openldap fix tree delete error handling --- 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:;