[gnome-software] shell-extensions: Fix a memory leak when parsing the list of extensions



commit 9d33f3f79586238f695fa5af45117daf7bba6de6
Author: Richard Hughes <richard hughsie com>
Date:   Wed May 8 12:33:53 2019 +0100

    shell-extensions: Fix a memory leak when parsing the list of extensions
    
    This was alone leaking 1.5Mb of RSS every time we refreshed.

 plugins/shell-extensions/gs-plugin-shell-extensions.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/plugins/shell-extensions/gs-plugin-shell-extensions.c 
b/plugins/shell-extensions/gs-plugin-shell-extensions.c
index 1c021873..628d046b 100644
--- a/plugins/shell-extensions/gs-plugin-shell-extensions.c
+++ b/plugins/shell-extensions/gs-plugin-shell-extensions.c
@@ -726,9 +726,10 @@ gs_plugin_appstream_load_json_cb (XbBuilderSource *self,
 
        /* parse each app */
        for (guint i = 0; i < json_array_get_length (json_extensions_array); i++) {
-               XbBuilderNode *component;
                JsonNode *json_extension;
                JsonObject *json_extension_obj;
+               g_autoptr(XbBuilderNode) component = NULL;
+
                json_extension = json_array_get_element (json_extensions_array, i);
                json_extension_obj = json_node_get_object (json_extension);
                component = gs_plugin_shell_extensions_parse_app (plugin,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]