summaryrefslogtreecommitdiff
path: root/libgpo
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-03-28 15:49:30 -0500
committerJeremy Allison <jra@samba.org>2018-04-04 00:44:23 +0200
commit5b52c308af6a21d290b964ddc64128b61faaaf6a (patch)
tree062a4ea22c092d91dc20bf1ad70578de75373964 /libgpo
parent54fc90025b0100dfa87e196d75b38ac87c40e7ee (diff)
downloadsamba-5b52c308af6a21d290b964ddc64128b61faaaf6a.tar.gz
pygpo: Fix CID 1422263 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'libgpo')
-rw-r--r--libgpo/pygpo.c3
1 files changed, 1 insertions, 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;
}
}