python: samba.gensec: Fix error handling in set_credentials() function
authorLumir Balhar <lbalhar@redhat.com>
Mon, 30 Jan 2017 13:18:46 +0000 (14:18 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 10 Mar 2017 06:31:12 +0000 (07:31 +0100)
Add `return NULL;` to error handling part of `set_credentials()`
function.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
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)));
                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);
        }
 
        status = gensec_set_credentials(security, creds);