From 9dcad792b6d5ff0481da467b1c6b4524cf462ba8 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Mon, 4 Oct 2010 00:43:33 +0400 Subject: 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 --- source4/lib/ldb/pyldb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb') 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) { -- cgit