From 2e76b798fe9732284a50b43cf10a0f3802ea6e4f Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 21 Jun 2011 22:25:22 +0200 Subject: ldb:"ldb_extended" -make the call more similar to "ldb_search" For example NULL out the LDB result pointer on failures. Signed-off-by: Andrew Tridgell --- lib/ldb/common/ldb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/ldb') diff --git a/lib/ldb/common/ldb.c b/lib/ldb/common/ldb.c index 433f30b7c1..a4c04cec46 100644 --- a/lib/ldb/common/ldb.c +++ b/lib/ldb/common/ldb.c @@ -1417,6 +1417,7 @@ int ldb_extended(struct ldb_context *ldb, struct ldb_result *res; *_res = NULL; + req = NULL; res = talloc_zero(ldb, struct ldb_result); if (!res) { @@ -1427,6 +1428,8 @@ int ldb_extended(struct ldb_context *ldb, oid, data, NULL, res, ldb_extended_default_callback, NULL); + ldb_req_set_location(req, "ldb_extended"); + if (ret != LDB_SUCCESS) goto done; ldb_set_timeout(ldb, req, 0); /* use default timeout */ @@ -1437,13 +1440,14 @@ int ldb_extended(struct ldb_context *ldb, ret = ldb_wait(req->handle, LDB_WAIT_ALL); } - talloc_free(req); - done: if (ret != LDB_SUCCESS) { talloc_free(res); + res = NULL; } + talloc_free(req); + *_res = res; return ret; } -- cgit