diff options
-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 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; |