[gnome-software] steam: Fix a rather large memory leak when parsing an appinfo file



commit 4c20e5cfb1bbbdae02e982b661bcc3f377098613
Author: Kalev Lember <klember redhat com>
Date:   Sat Jan 28 16:54:14 2017 +0100

    steam: Fix a rather large memory leak when parsing an appinfo file
    
    I had 541,217 bytes leaked in about a day.

 src/plugins/gs-plugin-steam.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-steam.c b/src/plugins/gs-plugin-steam.c
index 07b7d59..7f1d488 100644
--- a/src/plugins/gs-plugin-steam.c
+++ b/src/plugins/gs-plugin-steam.c
@@ -133,10 +133,10 @@ gs_plugin_steam_parse_appinfo_file (const gchar *filename, GError **error)
        GPtrArray *apps;
        GHashTable *app = NULL;
        const gchar *tmp;
-       guint8 *data = NULL;
        gsize data_len = 0;
        guint i = 0;
        gboolean debug =  g_getenv ("GS_PLUGIN_STEAM_DEBUG") != NULL;
+       g_autofree guint8 *data = NULL;
 
        /* load file */
        if (!g_file_get_contents (filename, (gchar **) &data, &data_len, error)) {


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