summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/common/ldb.c')
-rw-r--r--source4/lib/ldb/common/ldb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index b664ba680d..4b4cc30de8 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -305,10 +305,10 @@ int ldb_request(struct ldb_context *ldb, struct ldb_request *request)
/* the search call is the only one that returns something
other than a status code. We steal the results into
the context of the ldb before freeing the request */
- if (request->operation == LDB_REQ_SEARCH) {
+ if (status == LDB_SUCCESS && request->operation == LDB_REQ_SEARCH) {
request->op.search.res = talloc_steal(ldb, r->op.search.res);
}
- if (request->operation == LDB_ASYNC_SEARCH) {
+ if (status == LDB_SUCCESS && request->operation == LDB_ASYNC_SEARCH) {
request->async.handle = r->async.handle;
}
talloc_free(r);