summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/pyldb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 57407ba0b6..25f4661dce 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -1212,14 +1212,14 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
ldb_search_default_callback,
NULL);
- talloc_steal(req, attrs);
-
if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
return NULL;
}
+ talloc_steal(req, attrs);
+
ret = ldb_request(ldb_ctx, req);
if (ret == LDB_SUCCESS) {