[glib] resources: Plug mem leaks in resource compiler



commit d8b295abb3e34ce8fe5e7c16bf3ae208d70a3205
Author: Christian Persch <chpe gnome org>
Date:   Sat Jan 14 21:28:29 2012 +0100

    resources: Plug mem leaks in resource compiler
    
    ==13007== 173 bytes in 1 blocks are definitely lost in loss record 90 of 106
    ==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
    ==13007==    by 0x407E318: g_try_malloc (gmem.c:271)
    ==13007==    by 0x40654DE: g_file_get_contents (gfileutils.c:756)
    ==13007==    by 0x804A531: main (glib-compile-resources.c:580)
    
    ==13007== 521 (56 direct, 465 indirect) bytes in 1 blocks are definitely lost in loss record 100 of 106
    ==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
    ==13007==    by 0x407E160: g_malloc (gmem.c:159)
    ==13007==    by 0x4091D8D: g_slice_alloc (gslice.c:1003)
    ==13007==    by 0x40674A1: g_hash_table_new_full (ghash.c:676)
    ==13007==    by 0x804B252: gvdb_hash_table_new (gvdb-builder.c:76)
    ==13007==    by 0x43C66B2: (below main) (libc-start.c:226)

 gio/glib-compile-resources.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index d5d8f75..5b9b24e 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -687,12 +687,13 @@ main (int argc, char **argv)
 		 "}\n", c_name, c_name);
 
       fclose (file);
+
+      g_free (data);
     }
 
   g_free (binary_target);
-
-
   g_free (target);
+  g_hash_table_destroy (table);
 
   return 0;
 }



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