[glib] Plug a mem leak in g-file-info test



commit d5d277dccf3637518b3a34af1609ffd60ce1e308
Author: Christian Persch <chpe gnome org>
Date:   Fri Sep 3 15:37:08 2010 -0400

    Plug a mem leak in g-file-info test
    
    ==2395== 64 bytes in 1 blocks are definitely lost in loss record 381 of 407
    ==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
    ==2395==    by 0x40571A5: g_realloc (gmem.c:181)
    ==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
    ==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
    ==2395==    by 0x4199AA9: g_file_info_list_attributes (gfileinfo.c:646)
    ==2395==    by 0x80491CE: test_g_file_info (g-file-info.c:76)
    
    ==2395== 132 (64 direct, 68 indirect) bytes in 1 blocks are definitely lost in loss record 396 of 407
    ==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
    ==2395==    by 0x40571A5: g_realloc (gmem.c:181)
    ==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
    ==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
    ==2395==    by 0x4199A82: g_file_info_list_attributes (gfileinfo.c:642)
    ==2395==    by 0x80492B7: test_g_file_info (g-file-info.c:86)
    
    Bug #628331.

 gio/tests/g-file-info.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c
index 80bdd6e..ec0ae27 100644
--- a/gio/tests/g-file-info.c
+++ b/gio/tests/g-file-info.c
@@ -76,7 +76,8 @@ test_g_file_info (void)
   attr_list = g_file_info_list_attributes (info, NULL);
   g_assert (attr_list != NULL);
   g_assert (*attr_list == NULL);
-	
+  g_strfreev (attr_list);
+
   g_file_info_set_attribute_byte_string (info, G_FILE_ATTRIBUTE_STANDARD_NAME, TEST_NAME);
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, TEST_DISPLAY_NAME);
   g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE, TEST_SIZE);
@@ -86,7 +87,8 @@ test_g_file_info (void)
   attr_list = g_file_info_list_attributes (info, NULL);
   g_assert (attr_list != NULL);
   g_assert (*attr_list != NULL);
-	
+  g_strfreev (attr_list);
+
   test_assigned_values (info);
 	
   /*  Test dups */



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