From 5b52c308af6a21d290b964ddc64128b61faaaf6a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 28 Mar 2018 15:49:30 -0500 Subject: [PATCH] pygpo: Fix CID 1422263 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Reviewed-by: Stefan Metzmacher --- libgpo/pygpo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index ac6e3237a82..db336021125 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -264,12 +264,12 @@ static PyObject* py_ads_connect(ADS *self) Py_RETURN_FALSE; } self->ads_ptr->auth.password = smb_xstrdup(passwd); + SAFE_FREE(passwd); self->ads_ptr->auth.realm = smb_xstrdup(self->ads_ptr->server.realm); if (!strupper_m(self->ads_ptr->auth.realm)) { PyErr_SetString(PyExc_SystemError, "Failed to strdup"); TALLOC_FREE(frame); - SAFE_FREE(passwd); Py_RETURN_FALSE; } @@ -278,7 +278,6 @@ static PyObject* py_ads_connect(ADS *self) PyErr_SetString(PyExc_SystemError, "ads_connect() failed"); TALLOC_FREE(frame); - SAFE_FREE(passwd); Py_RETURN_FALSE; } }