diff options
author | Kristján Valur <kristjan@rvx.is> | 2019-02-28 15:15:14 +0000 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-03-07 15:08:19 +0000 |
commit | c25e7953c6a4b26965bfbba40c793d13690ba68c (patch) | |
tree | 8328db9aba72f17293eba5a72161a886e4417dae /libgpo/pygpo.c | |
parent | 5b4618ca7ac04667b9f5c3b8b11b4f66cb7cac71 (diff) | |
download | samba-c25e7953c6a4b26965bfbba40c793d13690ba68c.tar.gz |
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
Diffstat (limited to 'libgpo/pygpo.c')
-rw-r--r-- | libgpo/pygpo.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |