For example NULL out the LDB result pointer on failures.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
struct ldb_result *res;
*_res = NULL;
struct ldb_result *res;
*_res = NULL;
res = talloc_zero(ldb, struct ldb_result);
if (!res) {
res = talloc_zero(ldb, struct ldb_result);
if (!res) {
oid, data, NULL,
res, ldb_extended_default_callback,
NULL);
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 */
if (ret != LDB_SUCCESS) goto done;
ldb_set_timeout(ldb, req, 0); /* use default timeout */
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
}
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
}
done:
if (ret != LDB_SUCCESS) {
talloc_free(res);
done:
if (ret != LDB_SUCCESS) {
talloc_free(res);
*_res = res;
return ret;
}
*_res = res;
return ret;
}