Fixed: Memleak in Repository_config__get__()
There was a memleak because of a missing Py_INCREF() for self->config. We need 2 Py_INCREF() here because one is returned and one is kept internally. Thanks @delanne for reporting and providing the patch.
This commit is contained in:
@@ -497,6 +497,9 @@ Repository_config__get__(Repository *self)
|
|||||||
|
|
||||||
py_config->config = config;
|
py_config->config = config;
|
||||||
self->config = (PyObject*)py_config;
|
self->config = (PyObject*)py_config;
|
||||||
|
// We need 2 refs here.
|
||||||
|
// One is returned, one is keep internally.
|
||||||
|
Py_INCREF(self->config);
|
||||||
} else {
|
} else {
|
||||||
Py_INCREF(self->config);
|
Py_INCREF(self->config);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user