resources: Plug mem leaks in resource compiler
authorChristian Persch <chpe@gnome.org>
Sat, 14 Jan 2012 20:28:29 +0000 (21:28 +0100)
committerChristian Persch <chpe@gnome.org>
Wed, 18 Jan 2012 18:43:17 +0000 (19:43 +0100)
==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

index d5d8f75..5b9b24e 100644 (file)
@@ -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;
 }