From: Douglas Bagnall Date: Wed, 2 May 2018 22:26:34 +0000 (+1200) Subject: s4/pyauth: insist on proper ldb in context_new() X-Git-Tag: ldb-1.6.1~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f17e36c3f1128566c33d4eabb32cc49ecaaf42af;p=thirdparty%2Fsamba.git s4/pyauth: insist on proper ldb in context_new() Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- 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);