tests: plug memory leak in test_bin_info
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 7 Jan 2020 19:51:41 +0000 (14:51 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 8 Jan 2020 18:07:23 +0000 (18:07 +0000)
commit03a71671e4d8d483ff6d765082e6ebf1df9ef3e5
tree01717fab6751ddecaf5d7e9f4a7fdcb69937b57f
parentbe2129c0418a548c1c2d9031dcef2a1d3c62866d
tests: plug memory leak in test_bin_info

When running test_bin_info (e.g. through
tests/plugins/flt.lttng-utils.debug-info/test_bin_info_i386-linux-gnu)
under Valgrind, I get:

==25792== 1,112 (88 direct, 1,024 indirect) bytes in 1 blocks are definitely lost in loss record 18 of 20
==25792==    at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==25792==    by 0x55C2B10: g_malloc0 (gmem.c:129)
==25792==    by 0x55C86F2: g_option_context_new (goption.c:361)
==25792==    by 0x10CB25: main (test_bin_info.c:419)

Fix that by calling g_option_context_free.

Reported-by: Valgrind Memcheck
Change-Id: I9cd9a5ef786484169b9215744861af8cd6f5a9c8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2739
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
tests/plugins/flt.lttng-utils.debug-info/test_bin_info.c
This page took 0.024481 seconds and 4 git commands to generate.