diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-05-03 10:26:34 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-02-01 03:36:17 +0100 |
commit | f17e36c3f1128566c33d4eabb32cc49ecaaf42af (patch) | |
tree | 39c838767c2401d98aed88a49bbfd650572c340b | |
parent | a7e0741372d740b6999e873bf55fc6362d594c8e (diff) | |
download | samba-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.c | 4 |
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); |