1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3/py_passdb: maintain correct refcount on allocation failure

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Douglas Bagnall 2018-05-03 09:39:18 +12:00 committed by Noel Power
parent 1f07c478ec
commit 3584fe46d9

View File

@ -3945,6 +3945,7 @@ MODULE_INIT_FUNC(passdb)
dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(mod, "dom_sid");
if (dom_sid_Type == NULL) {
Py_DECREF(mod);
talloc_free(frame);
return NULL;
}
@ -3953,6 +3954,7 @@ MODULE_INIT_FUNC(passdb)
security_Type = (PyTypeObject *)PyObject_GetAttrString(mod, "descriptor");
Py_DECREF(mod);
if (security_Type == NULL) {
Py_DECREF(dom_sid_Type);
talloc_free(frame);
return NULL;
}
@ -3960,6 +3962,8 @@ MODULE_INIT_FUNC(passdb)
/* Import GUID type from dcerpc.misc */
mod = PyImport_ImportModule("samba.dcerpc.misc");
if (mod == NULL) {
Py_DECREF(security_Type);
Py_DECREF(dom_sid_Type);
talloc_free(frame);
return NULL;
}
@ -3967,6 +3971,8 @@ MODULE_INIT_FUNC(passdb)
guid_Type = (PyTypeObject *)PyObject_GetAttrString(mod, "GUID");
Py_DECREF(mod);
if (guid_Type == NULL) {
Py_DECREF(security_Type);
Py_DECREF(dom_sid_Type);
talloc_free(frame);
return NULL;
}