From eec236c1f295ff4e60b4d88db440771a18e0a6e3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 6 Mar 2006 21:40:47 +0000 Subject: r13900: don't segfault on error (This used to be commit cf7ad707578ee4dbd5dbf3c83f1f4ede42de3835) --- source4/lib/ldb/common/ldb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') 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); -- cgit