GKeyFile: free group comments when the group is removed
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 12 Dec 2011 18:35:14 +0000 (18:35 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 14 Dec 2011 12:26:16 +0000 (12:26 +0000)
These were leaked. Valgrind was sad.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
glib/gkeyfile.c

index dc4faf3..e8eb861 100644 (file)
@@ -3752,6 +3752,12 @@ g_key_file_remove_group_node (GKeyFile *key_file,
 
   g_warn_if_fail (group->key_value_pairs == NULL);
 
+  if (group->comment)
+    {
+      g_key_file_key_value_pair_free (group->comment);
+      group->comment = NULL;
+    }
+
   if (group->lookup_map)
     {
       g_hash_table_destroy (group->lookup_map);