summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-10-04 00:43:33 +0400
committerMatthieu Patou <mat@sn-devel-104.sn.samba.org>2010-10-04 19:42:19 +0000
commit9dcad792b6d5ff0481da467b1c6b4524cf462ba8 (patch)
treede724a370563bb3c912d80df4f45b0f5024a48b8 /source4/lib/ldb
parentb53fbc75acc525f2e2450370e704a62791271788 (diff)
downloadsamba-9dcad792b6d5ff0481da467b1c6b4524cf462ba8.tar.gz
samba-9dcad792b6d5ff0481da467b1c6b4524cf462ba8.tar.bz2
samba-9dcad792b6d5ff0481da467b1c6b4524cf462ba8.zip
pyldb: test return code before trying to talloc_steal
Otherwise you can have an error on the talloc_steal as the req can have been not talloced yet
Diffstat (limited to 'source4/lib/ldb')
-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) {