summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-05-03 10:26:34 +1200
committerAndrew Bartlett <abartlet@samba.org>2019-02-01 03:36:17 +0100
commitf17e36c3f1128566c33d4eabb32cc49ecaaf42af (patch)
tree39c838767c2401d98aed88a49bbfd650572c340b
parenta7e0741372d740b6999e873bf55fc6362d594c8e (diff)
downloadsamba-f17e36c3f1128566c33d4eabb32cc49ecaaf42af.tar.gz
s4/pyauth: insist on proper ldb in context_new()
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/auth/pyauth.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c
index a9a1ee10fcf..0736859092c 100644
--- a/source4/auth/pyauth.c
+++ b/source4/auth/pyauth.c
@@ -353,6 +353,10 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
if (py_ldb != Py_None) {
ldb = pyldb_Ldb_AsLdbContext(py_ldb);
+ if (ldb == NULL) {
+ talloc_free(mem_ctx);
+ return NULL;
+ }
}
lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx);