mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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>
This commit is contained in:
parent
54fc90025b
commit
5b52c308af
@ -264,12 +264,12 @@ static PyObject* py_ads_connect(ADS *self)
|
|||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
self->ads_ptr->auth.password = smb_xstrdup(passwd);
|
self->ads_ptr->auth.password = smb_xstrdup(passwd);
|
||||||
|
SAFE_FREE(passwd);
|
||||||
self->ads_ptr->auth.realm =
|
self->ads_ptr->auth.realm =
|
||||||
smb_xstrdup(self->ads_ptr->server.realm);
|
smb_xstrdup(self->ads_ptr->server.realm);
|
||||||
if (!strupper_m(self->ads_ptr->auth.realm)) {
|
if (!strupper_m(self->ads_ptr->auth.realm)) {
|
||||||
PyErr_SetString(PyExc_SystemError, "Failed to strdup");
|
PyErr_SetString(PyExc_SystemError, "Failed to strdup");
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
SAFE_FREE(passwd);
|
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,6 @@ static PyObject* py_ads_connect(ADS *self)
|
|||||||
PyErr_SetString(PyExc_SystemError,
|
PyErr_SetString(PyExc_SystemError,
|
||||||
"ads_connect() failed");
|
"ads_connect() failed");
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
SAFE_FREE(passwd);
|
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user