1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

pygpo: take ownership of password pointer

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822
Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu Mar  7 15:08:19 UTC 2019 on sn-devel-144
This commit is contained in:
Kristján Valur 2019-02-28 15:15:14 +00:00 committed by Noel Power
parent 5b4618ca7a
commit c25e7953c6

View File

@ -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;