summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/pyldb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 0bc644716d..521fa498aa 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -848,6 +848,12 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
talloc_free(req);
+ if (ret != LDB_SUCCESS) {
+ talloc_free(res);
+ PyErr_LDB_ERROR_IS_ERR_RAISE(ret, ldb_ctx);
+ return NULL;
+ }
+
return PyLdbResult_FromResult(res);
}