[glib] resources: Plug a mem leak



commit ffe7a3293f7e69fab1211f014a54b78fb7611ee0
Author: Christian Persch <chpe gnome org>
Date:   Sun Feb 5 16:10:48 2012 +0100

    resources: Plug a mem leak
    
    ==27020== 44 (24 direct, 20 indirect) bytes in 1 blocks are definitely lost in loss record 684 of 936
    ==27020==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==27020==    by 0x4084724: standard_malloc (gmem.c:85)
    ==27020==    by 0x40847C7: g_malloc (gmem.c:159)
    ==27020==    by 0x409B1E1: g_slice_alloc (gslice.c:1003)
    ==27020==    by 0x40BC038: g_variant_get_child_value (gvariant-core.c:969)
    ==27020==    by 0x40B5277: g_variant_get_variant (gvariant.c:749)
    ==27020==    by 0x4273182: gvdb_table_value_from_item (gvdb-reader.c:478)
    ==27020==    by 0x42731E8: gvdb_table_get_value (gvdb-reader.c:509)
    ==27020==    by 0x4228B36: do_lookup (gresource.c:280)
    ==27020==    by 0x4228F56: g_resource_get_info (gresource.c:492)

 gio/gresource.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gio/gresource.c b/gio/gresource.c
index ce4476f..9282843 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -310,6 +310,7 @@ static gboolean do_lookup (GResource *resource,
             *data_size = g_variant_get_size (array) - 1;
         }
       g_variant_unref (array);
+      g_variant_unref (value);
 
       res = TRUE;
     }



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