The result from spoa evaluation of the user provided python code is
never passed back to the main spoa process nor freed.
Same for the keyword list passed.
This results into the elements never freed by Python as reference count
never goes down.
https://docs.python.org/3/extending/extending.html#reference-counting-in-python
This patch must be backported as far as 2.0.
(cherry picked from commit
222f060be379126fa0890f6cd2820c4bd8d5ac90)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
85e705ece1519756fae0b610793cdf602cf25bf6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
}
result = PyObject_Call(python_ref, empty_array, fkw);
+ Py_DECREF(fkw);
if (result == NULL) {
PyErr_Print();
return 0;
}
+ if (result != Py_None) {
+ Py_DECREF(result);
+ }
return 1;
}