From f53e12b41b8d669c175536449fc676389cc3dd57 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 2 Apr 2006 11:17:07 +0000 Subject: r14857: fix bugs noticed by the ibm code checker metze (This used to be commit 07626bf3c7dc7162b852cc27e5a7c313ede3862a) --- source4/ldap_server/ldap_backend.c | 7 ++++--- 1 file 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; -- cgit