[glib/glib-2-28] GKeyFile: free group comments when the group is removed



commit f65c741db45681010f497fae296158cae271e1ff
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Mon Dec 12 18:35:14 2011 +0000

    GKeyFile: free group comments when the group is removed
    
    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 |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c
index 0819ecf..115372d 100644
--- a/glib/gkeyfile.c
+++ b/glib/gkeyfile.c
@@ -3310,6 +3310,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);



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