libgpo: Fix CID 1422263 Resource leak
authorVolker Lendecke <vl@samba.org>
Tue, 21 Nov 2017 19:41:47 +0000 (20:41 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 22 Nov 2017 01:03:16 +0000 (02:03 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 22 02:03:17 CET 2017 on sn-devel-144

libgpo/pygpo.c

index 619985239cb40db193bd554710144926cea66588..d7bb17382b25d7b56d76f762c91abff193455cb7 100644 (file)
@@ -248,6 +248,7 @@ static PyObject* py_ads_connect(ADS *self)
                if (!strupper_m(self->ads_ptr->auth.realm)) {
                        PyErr_SetString(PyExc_SystemError, "Failed to strdup");
                        TALLOC_FREE(frame);
+                       SAFE_FREE(passwd);
                        Py_RETURN_FALSE;
                }
 
@@ -255,6 +256,7 @@ static PyObject* py_ads_connect(ADS *self)
                if (!ADS_ERR_OK(status)) {
                        PyErr_SetString(PyExc_SystemError, "ads_connect() failed");
                        TALLOC_FREE(frame);
+                       SAFE_FREE(passwd);
                        Py_RETURN_FALSE;
                }
        }