summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/ldap_server/ldap_backend.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index b9f002f157..1b5bc9fe8b 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -123,8 +123,8 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
const char **attrs = NULL;
const char *errstr = NULL;
int success_limit = 1;
- int result = LDAP_SUCCESS;
- int ldb_ret;
+ int result = -1;
+ int ldb_ret = -1;
int i, j;
DEBUG(10, ("SearchRequest"));
@@ -227,7 +227,8 @@ reply:
done->dn = NULL;
done->referral = NULL;
- if (ldb_ret == LDB_SUCCESS) {
+ if (result != -1) {
+ } else if (ldb_ret == LDB_SUCCESS) {
if (res->count >= success_limit) {
DEBUG(10,("SearchRequest: results: [%d]\n", res->count));
result = LDAP_SUCCESS;