python: samba.gensec: Fix error handling in set_credentials() function
[nivanova/samba-autobuild/.git] / source4 / auth / gensec / pygensec.c
index eba84f0b856332627377b527b1a63a7dfafac7e4..56016af312718705645bd587076f96c43078654a 100644 (file)
@@ -255,6 +255,7 @@ static PyObject *py_gensec_set_credentials(PyObject *self, PyObject *args)
                PyErr_Format(PyExc_TypeError,
                             "Expected samba.credentaials for credentials argument got  %s",
                             talloc_get_name(pytalloc_get_ptr(py_creds)));
+               return NULL;
        }
 
        status = gensec_set_credentials(security, creds);