summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/helpers.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-09 13:01:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-09 13:01:58 (GMT)
commit5863af232b8fc57de210702afe659a7383bb8840 (patch)
tree18e6fd0fb7be2f01d23cda34f8d7b3f29b1a250b /plugins/pychrysalide/helpers.c
parent32bef30025f5e3f513c2b4936c0573cc3b629961 (diff)
Fixed another batch of memory leaks.
Diffstat (limited to 'plugins/pychrysalide/helpers.c')
-rw-r--r--plugins/pychrysalide/helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c
index f744475..48b805c 100644
--- a/plugins/pychrysalide/helpers.c
+++ b/plugins/pychrysalide/helpers.c
@@ -434,6 +434,8 @@ bool register_python_module_methods(PyObject *module, PyMethodDef *defs)
if (result)
{
+ Py_INCREF(item);
+
ret = PyDict_SetItemString(features_dict, iter->ml_name, item);
result = (ret == 0);
assert(result);
@@ -483,6 +485,8 @@ static bool include_python_type_into_features(PyObject *dict, PyTypeObject *type
result = (item != NULL);
assert(result);
+ Py_INCREF(item);
+
ret = PyDict_SetItemString(features_dict, name, item);
result = (ret == 0);
assert(result);