X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-ldbm%2Fsearch.c;h=e2e5b113c9bbf82dc9031ab4de6ed2164026e5a3;hb=b0b3eff457f0e431c4fd094d3d9cfeb6383df91d;hp=3ce70492a91c90858b31eaa3c038b370279d8fdc;hpb=ec9e19a573de62875a4a67dbdbbbbba2c723f5ea;p=openldap
diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c
index 3ce70492a9..e2e5b113c9 100644
--- a/servers/slapd/back-ldbm/search.c
+++ b/servers/slapd/back-ldbm/search.c
@@ -1,8 +1,17 @@
/* search.c - ldbm backend search function */
/* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
*/
#include "portable.h"
@@ -111,6 +120,8 @@ ldbm_back_search(
ber_bvarray_free( rs->sr_ref );
ber_memfree( matched_dn.bv_val );
+ rs->sr_ref = NULL;
+ rs->sr_matched = NULL;
return LDAP_REFERRAL;
}
@@ -155,6 +166,8 @@ ldbm_back_search(
}
ber_memfree( matched_dn.bv_val );
+ rs->sr_ref = NULL;
+ rs->sr_matched = NULL;
return LDAP_OTHER;
}
@@ -193,7 +206,7 @@ searchit:
rs->sr_err = LDAP_SUCCESS;
send_ldap_result( op, rs );
- rc = LDAP_OTHER;
+ rc = LDAP_SUCCESS;
goto done;
}
@@ -214,7 +227,7 @@ searchit:
if ( ID_BLOCK_NIDS( candidates ) > (unsigned) limit->lms_s_unchecked ) {
send_ldap_error( op, rs, LDAP_ADMINLIMIT_EXCEEDED,
NULL );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
}
@@ -247,7 +260,7 @@ searchit:
send_ldap_error( op, rs,
LDAP_ADMINLIMIT_EXCEEDED,
NULL );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
@@ -271,7 +284,7 @@ searchit:
send_ldap_error( op, rs,
LDAP_ADMINLIMIT_EXCEEDED,
NULL );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
@@ -291,7 +304,7 @@ searchit:
/* check for abandon */
if ( op->o_abandon ) {
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
@@ -299,7 +312,7 @@ searchit:
if ( op->oq_search.rs_tlimit != -1 && slap_get_time() > stoptime ) {
rs->sr_err = LDAP_TIMELIMIT_EXCEEDED;
send_ldap_result( op, rs );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
@@ -470,7 +483,7 @@ searchit:
cache_return_entry_r( &li->li_cache, e );
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
send_ldap_result( op, rs );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
@@ -485,7 +498,7 @@ searchit:
break;
case -1: /* connection closed */
cache_return_entry_r( &li->li_cache, e );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
}
@@ -526,7 +539,7 @@ loop_continue:
rs->sr_ref = rs->sr_v2ref;
send_ldap_result( op, rs );
- rc = 0;
+ rc = LDAP_SUCCESS;
done:
ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);