[Libosinfo] [PATCH 2/8] test-isodetect: Fix leak of 'langs' GList

Daniel P. Berrange berrange at redhat.com
Thu Nov 5 16:55:19 UTC 2015


On Thu, Nov 05, 2015 at 05:20:40PM +0100, Christophe Fergeau wrote:
> This fixes:
> ==12890== 1,032 bytes in 43 blocks are definitely lost in loss record 2,129 of 2,169
> ==12890==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==12890==    by 0x6A514D8: g_malloc (in /usr/lib64/libglib-2.0.so.0.4600.1)
> ==12890==    by 0x6A68622: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4600.1)
> ==12890==    by 0x6A47EA9: g_list_copy_deep (in /usr/lib64/libglib-2.0.so.0.4600.1)
> ==12890==    by 0x55400A8: osinfo_entity_get_param_value_list (osinfo_entity.c:424)
> ==12890==    by 0x555476E: osinfo_media_get_languages (osinfo_media.c:1238)
> ==12890==    by 0x402CCA: test_langs (test-isodetect.c:300)
> ==12890==    by 0x4031E8: test_one (test-isodetect.c:350)
> ==12890==    by 0x4033B8: test_windows (test-isodetect.c:387)
> ==12890==    by 0x532B78A: tcase_run_tfun_nofork.isra.9 (check_run.c:390)
> ==12890==    by 0x532BB7C: srunner_iterate_tcase_tfuns (check_run.c:231)
> ==12890==    by 0x532BB7C: srunner_run_tcase (check_run.c:373)
> ==12890==    by 0x532BB7C: srunner_iterate_suites (check_run.c:195)
> ==12890==    by 0x532BB7C: srunner_run (check_run.c:782)
> ==12890==    by 0x4037B9: main (test-isodetect.c:496)
> ---
>  test/test-isodetect.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/test/test-isodetect.c b/test/test-isodetect.c
> index 9684052..666357a 100644
> --- a/test/test-isodetect.c
> +++ b/test/test-isodetect.c
> @@ -305,6 +305,7 @@ static void test_langs(struct ISOInfo *info)
>                      it->data, info->filename);
>          g_hash_table_remove(info->langs, it->data);
>      }
> +    g_list_free(langs);
>      fail_unless(g_hash_table_size(info->langs) == 0,
>                  "some languages were not identified on ISO %s",
>                  info->filename);

ACK


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the Libosinfo mailing list