summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Mueller <muelli@cryptobitch.de>2016-09-09 12:53:11 +0200
committerTobias Mueller <muelli@cryptobitch.de>2016-09-12 16:54:53 +0200
commita50e377d6a2d88c39b6d2a3bcd1d1c10afa478b2 (patch)
tree3ccb605d27882d0e45021b8afefde0f5ed5c95bb
parente21bbc777180c28ceb7a796a45f426afaec8d9f2 (diff)
downloadgobject-introspection-a50e377d6a2d88c39b6d2a3bcd1d1c10afa478b2.tar.gz
gthash: free cmph objects
If not done, it would leak the memory as address sanitizer reports: ==1294==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fa7a94b7602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x44c7a7 in __config_new girepository/cmph/cmph_structs.c:11 #2 0x44aaa7 in cmph_config_new girepository/cmph/cmph.c:291 #3 0x446fb5 in _gi_typelib_hash_builder_prepare girepository/gthash.c:114 #4 0x406cf7 in add_directory_index_section girepository/girmodule.c:270 #5 0x409ee6 in _g_ir_module_build_typelib girepository/girmodule.c:546 #6 0x404ada in main tools/compiler.c:217 #7 0x7fa7a70d482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) ==4091==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fc20c854602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x44a3f3 in cmph_io_vector_new girepository/cmph/cmph.c:228 #2 0x44a965 in cmph_io_vector_adapter girepository/cmph/cmph.c:276 #3 0x446f9f in _gi_typelib_hash_builder_prepare girepository/gthash.c:113 #4 0x406cf7 in add_directory_index_section girepository/girmodule.c:270 #5 0x409ee6 in _g_ir_module_build_typelib girepository/girmodule.c:546 #6 0x404ada in main tools/compiler.c:217 #7 0x7fc20a47182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
-rw-r--r--girepository/gthash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/girepository/gthash.c b/girepository/gthash.c
index 831c87e9..7440913a 100644
--- a/girepository/gthash.c
+++ b/girepository/gthash.c
@@ -129,6 +129,8 @@ _gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder)
builder->dirmap_offset = ALIGN_VALUE (offset, 4);
builder->packed_size = builder->dirmap_offset + (num_elts * sizeof(guint16));
out:
+ cmph_config_destroy (config);
+ cmph_io_vector_adapter_destroy (io);
return builder->buildable;
}