mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s4/param/provision py_dom_sid_FromSid: avoid python memleak
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Tue Jan 29 16:54:48 CET 2019 on sn-devel-144
This commit is contained in:
parent
a3aa5af3d5
commit
ca93b1e15a
@ -199,13 +199,15 @@ static PyObject *py_dom_sid_FromSid(struct dom_sid *sid)
|
||||
PyObject *mod_security, *dom_sid_Type;
|
||||
|
||||
mod_security = PyImport_ImportModule("samba.dcerpc.security");
|
||||
if (mod_security == NULL)
|
||||
if (mod_security == NULL) {
|
||||
return NULL;
|
||||
|
||||
}
|
||||
dom_sid_Type = PyObject_GetAttrString(mod_security, "dom_sid");
|
||||
if (dom_sid_Type == NULL)
|
||||
if (dom_sid_Type == NULL) {
|
||||
Py_DECREF(mod_security);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
Py_DECREF(mod_security);
|
||||
return pytalloc_reference((PyTypeObject *)dom_sid_Type, sid);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user