diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-05-03 09:39:18 +1200 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-01-29 13:45:32 +0100 |
commit | 3584fe46d92037c1fb9825d7d25ecc9bdd60c0f4 (patch) | |
tree | 9c4698d1908dd978f98d8331558f8c5de8019179 /source3/passdb | |
parent | 1f07c478ec1823c322b0de4db1a51029de8e5056 (diff) | |
download | samba-3584fe46d92037c1fb9825d7d25ecc9bdd60c0f4.tar.gz |
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>
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/py_passdb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index 1b4ec3d531e..2ac2942a47f 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -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; } |