about summary refs log tree commit diff stats
path: root/src/plugins/python_api.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-25 21:56:38 +0100
committerJames Booth <boothj5@gmail.com>2016-07-25 21:56:38 +0100
commit943e91268c2489600ac1f28836fd0e24a0fd8dc2 (patch)
treea3e8bdba66089fff33598e5bc3d6de19f04de946 /src/plugins/python_api.c
parent139e53f388e06a91bebddbf144556db05ea61898 (diff)
downloadprofani-tty-943e91268c2489600ac1f28836fd0e24a0fd8dc2.tar.gz
Fix memory leaks
Diffstat (limited to 'src/plugins/python_api.c')
-rw-r--r--src/plugins/python_api.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c
index 8309e5ec..ee8a874c 100644
--- a/src/plugins/python_api.c
+++ b/src/plugins/python_api.c
@@ -740,7 +740,9 @@ python_api_settings_get_string(PyObject *self, PyObject *args)
     disable_python_threads();
 
     if (res) {
-        return Py_BuildValue("s", res);
+        PyObject *pyres = Py_BuildValue("s", res);
+        free(res);
+        return pyres;
     } else {
         Py_RETURN_NONE;
     }