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:
parent
85b7574b91
commit
e29c34942d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user