From c25e7953c6a4b26965bfbba40c793d13690ba68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur?= Date: Thu, 28 Feb 2019 15:15:14 +0000 Subject: pygpo: take ownership of password pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Mar 7 15:08:19 UTC 2019 on sn-devel-144 --- libgpo/pygpo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libgpo/pygpo.c') diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index af75e981072..e82cc5c984f 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -253,13 +253,13 @@ static PyObject* py_ads_connect(ADS *self) ret = asprintf(&(self->ads_ptr->auth.user_name), "%s$", lp_netbios_name()); if (ret == -1) { + SAFE_FREE(passwd); PyErr_NoMemory(); goto err; } - self->ads_ptr->auth.password = smb_xstrdup(passwd); - SAFE_FREE(passwd); + self->ads_ptr->auth.password = passwd; /* take ownership of this data */ self->ads_ptr->auth.realm = - smb_xstrdup(self->ads_ptr->server.realm); + SMB_STRDUP(self->ads_ptr->server.realm); if (!strupper_m(self->ads_ptr->auth.realm)) { PyErr_SetString(PyExc_RuntimeError, "Failed to strupper"); goto err; -- cgit v1.2.1