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 6199852..d7bb173 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;
                }
        }