[aisleriot] window: Plug a small mem leak



commit 650070f80f1fabeb3646a1e08913f78260d31653
Author: Christian Persch <chpe gnome org>
Date:   Thu Dec 11 18:43:24 2014 +0100

    window: Plug a small mem leak
    
    ==18302== 19 bytes in 2 blocks are definitely lost in loss record 2,961 of 9,265
    ==18302==    at 0x4027AB1: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==18302==    by 0x51558F9: g_malloc (gmem.c:97)
    ==18302==    by 0x5155C10: g_malloc_n (gmem.c:332)
    ==18302==    by 0x516FB80: g_strndup (gstrfuncs.c:418)
    ==18302==    by 0x5149592: g_key_file_parse_value_as_string (gkeyfile.c:4112)
    ==18302==    by 0x5145DEE: g_key_file_get_string_list (gkeyfile.c:1935)
    ==18302==    by 0x8069243: ar_conf_get_string_list (ar-conf.c:774)
    ==18302==    by 0x8062004: install_recently_played_menu (window.c:1181)
    ==18302==    by 0x8062A9B: game_type_changed_cb (window.c:1514)

 src/window.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/window.c b/src/window.c
index 024dc84..115cf6a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1207,8 +1207,7 @@ install_recently_played_menu (AisleriotWindow *window)
                            GTK_UI_MANAGER_MENUITEM, FALSE);
   }
 
-  /* The strings themselves are now owned by gobject data on the action */
-  g_free (recent_games);
+  g_strfreev (recent_games);
 }
 
 /* Card Theme menu */


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