[gnome-software/wip/kalev/gnome-3-22: 55/96] trivial: Fix a memory leak in the flatpak plugin



commit d5357f8ac18bf323c9bf6f6871fdd66ecf8c86f8
Author: Richard Hughes <richard hughsie com>
Date:   Fri Feb 17 11:18:09 2017 +0000

    trivial: Fix a memory leak in the flatpak plugin

 src/plugins/gs-flatpak.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index ebe8c85..6e78562 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -915,8 +915,8 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                        GError **error)
 {
        g_autoptr(GPtrArray) xrefs = NULL;
-       g_autoptr(GsAppList) list_new = gs_app_list_new ();
-       g_autoptr(GsAppList) list_tmp = gs_app_list_new ();
+       g_autoptr(GsAppList) list_new = NULL;
+       g_autoptr(GsAppList) list_tmp = NULL;
 
        /* get all the installed apps (no network I/O) */
        xrefs = flatpak_installation_list_installed_refs (self->installation,
@@ -927,6 +927,7 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
        }
 
        /* look at each installed xref */
+       list_tmp = gs_app_list_new ();
        for (guint i = 0; i < xrefs->len; i++) {
                FlatpakInstalledRef *xref = g_ptr_array_index (xrefs, i);
                const gchar *commit;


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