From: Douglas Bagnall Date: Tue, 24 Apr 2018 00:37:02 +0000 (+1200) Subject: s4/pyauth: check ldb argument in py_user_session() X-Git-Tag: ldb-1.6.1~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7e0741372d740b6999e873bf55fc6362d594c8e;p=thirdparty%2Fsamba.git s4/pyauth: check ldb argument in py_user_session() Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c index 26d8277887e..a9a1ee10fcf 100644 --- a/source4/auth/pyauth.c +++ b/source4/auth/pyauth.c @@ -190,6 +190,10 @@ static PyObject *py_user_session(PyObject *module, PyObject *args, PyObject *kwa } ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb); + if (ldb_ctx == NULL) { + talloc_free(mem_ctx); + return NULL; + } if (py_dn == Py_None) { user_dn = NULL;