For example NULL out the LDB result pointer on failures.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
struct ldb_result *res;
*_res = NULL;
+ req = NULL;
res = talloc_zero(ldb, struct ldb_result);
if (!res) {
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 */
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;
}