[glib] resources: tests: Plug a mem leak



commit 0ebb6339d15aa4ccc5a380dd35d116806c7005f3
Author: Christian Persch <chpe gnome org>
Date:   Sun Feb 5 16:39:51 2012 +0100

    resources: tests: Plug a mem leak
    
    ==509== 700 (20 direct, 680 indirect) bytes in 1 blocks are definitely lost in loss record 828 of 837
    ==509==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==509==    by 0x4084724: standard_malloc (gmem.c:85)
    ==509==    by 0x40847C7: g_malloc (gmem.c:159)
    ==509==    by 0x409B1E1: g_slice_alloc (gslice.c:1003)
    ==509==    by 0x405396B: g_bytes_new_with_free_func (gbytes.c:173)
    ==509==    by 0x405390D: g_bytes_new_take (gbytes.c:122)
    ==509==    by 0x804A48C: test_resource_data (resources.c:174)

 gio/tests/resources.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/resources.c b/gio/tests/resources.c
index 9b8fdf1..7619f7f 100644
--- a/gio/tests/resources.c
+++ b/gio/tests/resources.c
@@ -172,6 +172,7 @@ test_resource_data (void)
 
   data = g_bytes_new_take (content, content_size);
   resource = g_resource_new_from_data (data, &error);
+  g_bytes_unref (data);
   g_assert (resource != NULL);
   g_assert_no_error (error);
 



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