summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-01-23 15:15:07 +0000
committerNoel Power <npower@samba.org>2019-02-07 13:44:30 +0100
commit53d973f59c3514f9c288cc8e53a682176a5fc415 (patch)
tree99b0ff693f19501d46585f76533ec50dec769fa8 /source4/param
parent1be9b0cf1bc95715e83c27eabecbd4fa2022530b (diff)
downloadsamba-53d973f59c3514f9c288cc8e53a682176a5fc415.tar.gz
Cleanup references to module objects returned from PyImport_ImportModule
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/provision.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 48a471cf44d..10a657b981b 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -201,19 +201,23 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
static PyObject *py_dom_sid_FromSid(struct dom_sid *sid)
{
- PyObject *mod_security, *dom_sid_Type;
+ PyObject *mod_security = NULL, *dom_sid_Type = NULL, *result = NULL;
mod_security = PyImport_ImportModule("samba.dcerpc.security");
if (mod_security == NULL) {
return NULL;
}
+
dom_sid_Type = PyObject_GetAttrString(mod_security, "dom_sid");
if (dom_sid_Type == NULL) {
Py_DECREF(mod_security);
return NULL;
}
+
+ result = pytalloc_reference((PyTypeObject *)dom_sid_Type, sid);
Py_DECREF(mod_security);
- return pytalloc_reference((PyTypeObject *)dom_sid_Type, sid);
+ Py_DECREF(dom_sid_Type);
+ return result;
}
NTSTATUS provision_store_self_join(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,