From: Gilchrist Dadaglo <dada...@amazon.com>

IP addresses references passed in argument for ps_python are not freed after 
they have been used.
Leading to a small chance of mem leak if a lot of ip addresses are
passed around
---
 contrib/spoa_server/ps_python.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/spoa_server/ps_python.c b/contrib/spoa_server/ps_python.c
index 2cc97e3..c27387c 100644
--- a/contrib/spoa_server/ps_python.c
+++ b/contrib/spoa_server/ps_python.c
@@ -239,6 +239,8 @@ static PyObject *ps_python_set_var_ipv4(PyObject *self, 
PyObject *args)
                PyErr_SetString(spoa_error, "No space left available");
                return NULL;
        }
+       /* Once we set the IP value in the worker, we don't need it anymore... 
*/
+       Py_XDECREF(value);
        return Py_None;
 }
 
@@ -274,6 +276,8 @@ static PyObject *ps_python_set_var_ipv6(PyObject *self, 
PyObject *args)
                PyErr_SetString(spoa_error, "No space left available");
                return NULL;
        }
+       /* Once we set the IP value in the worker, we don't need it anymore... 
*/
+       Py_XDECREF(value);
        return Py_None;
 }
 
-- 
2.24.3.AMZN


Reply via email to