[gnome-software] trivial: Fix a memory leak when getting PackageKit application histories



commit 14314b4967afd4bda50f28bbc9b3e217b6e7e543
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jun 28 10:34:18 2016 +0100

    trivial: Fix a memory leak when getting PackageKit application histories

 src/plugins/gs-plugin-packagekit-history.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-history.c b/src/plugins/gs-plugin-packagekit-history.c
index 47f0e28..36f7382 100644
--- a/src/plugins/gs-plugin-packagekit-history.c
+++ b/src/plugins/gs-plugin-packagekit-history.c
@@ -186,11 +186,12 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
        /* get any results */
        tuple = g_variant_get_child_value (result, 0);
        for (i = 0; i < gs_app_list_length (list); i++) {
+               g_autoptr(GVariant) entries = NULL;
                app = gs_app_list_index (list, i);
                ret = g_variant_lookup (tuple,
                                        gs_app_get_source_default (app),
                                        "@aa{sv}",
-                                       &value);
+                                       &entries);
                if (!ret) {
                        /* make up a fake entry as we know this package was at
                         * least installed at some point in time */
@@ -210,7 +211,7 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
                }
 
                /* add history for application */
-               g_variant_iter_init (&iter, value);
+               g_variant_iter_init (&iter, entries);
                while ((value = g_variant_iter_next_value (&iter))) {
                        gs_plugin_packagekit_refine_add_history (app, value);
                        g_variant_unref (value);


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