Fix memory leak in print_searchpaths()
[libsigrokdecode.git] / srd.c
diff --git a/srd.c b/srd.c
index 248d8e5a69e3793450f50127a47e8a7563b416e0..22f47fcf26a869ad8856e90b6f7f34bc76be5741 100644 (file)
--- a/srd.c
+++ b/srd.c
@@ -172,6 +172,7 @@ static int print_searchpaths(void)
                py_path = PyList_GetItem(py_paths, i);
                py_bytes = PyUnicode_AsUTF8String(py_path);
                g_string_append_printf(s, " - %s\n", PyBytes_AsString(py_bytes));
+               Py_DECREF(py_bytes);
        }
        s->str[s->len - 1] = '\0';
        srd_dbg("%s", s->str);