]> git.sur5r.net Git - openldap/commitdiff
fix tree delete error handling
authorPierangelo Masarati <ando@openldap.org>
Tue, 21 Aug 2007 15:19:01 +0000 (15:19 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 21 Aug 2007 15:19:01 +0000 (15:19 +0000)
servers/slapd/back-sql/search.c

index e293151dead64c9c9bff39a209ecfb489452c627..2922d47ccc3c81c1481b106ff1db5bb95cf08cfd 100644 (file)
@@ -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:;