1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

decref results of PyStr_FromString

Where we create temporary objects (which are added to containers)
these objects already get there ref count incremented. In this case
we need to decref those objects to ensure they are released.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Noel Power 2019-01-23 18:08:58 +00:00 committed by Noel Power
parent 85b7574b91
commit e29c34942d

View File

@ -34,25 +34,34 @@
static PyObject *provision_module(void)
{
PyObject *name = PyStr_FromString("samba.provision");
PyObject *mod = NULL;
if (name == NULL)
return NULL;
return PyImport_Import(name);
mod = PyImport_Import(name);
Py_CLEAR(name);
return mod;
}
static PyObject *schema_module(void)
{
PyObject *name = PyStr_FromString("samba.schema");
PyObject *mod = NULL;
if (name == NULL)
return NULL;
return PyImport_Import(name);
mod = PyImport_Import(name);
Py_CLEAR(name);
return mod;
}
static PyObject *ldb_module(void)
{
PyObject *name = PyStr_FromString("ldb");
PyObject *mod = NULL;
if (name == NULL)
return NULL;
return PyImport_Import(name);
mod = PyImport_Import(name);
Py_CLEAR(name);
return mod;
}
static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx)