Fix memory leaks

This commit is contained in:
James Booth
2016-07-25 21:56:38 +01:00
parent 139e53f388
commit 943e91268c
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}