summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-06-21 22:25:22 +0200
committerAndrew Tridgell <tridge@samba.org>2011-09-19 10:57:03 +1000
commit2e76b798fe9732284a50b43cf10a0f3802ea6e4f (patch)
treeab5e6430914ad36a21a8d7972585ad31e3785fef /lib
parent966b5d5de2fc40ff77e2b947c61a2419795a2282 (diff)
downloadsamba-2e76b798fe9732284a50b43cf10a0f3802ea6e4f.tar.gz
samba-2e76b798fe9732284a50b43cf10a0f3802ea6e4f.tar.bz2
samba-2e76b798fe9732284a50b43cf10a0f3802ea6e4f.zip
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 <tridge@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/common/ldb.c8
1 files changed, 6 insertions, 2 deletions
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;
}