Fix: tests: free message iterator class in test_graph_topo.c
In a build with --enable-asan and optimizations (-O2), I see:
Direct leak of 112 byte(s) in 1 object(s) allocated from:
#0 0x7fc88d6bf411 in __interceptor_calloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77
#1 0x7fc88d3b4631 in g_malloc0 (/usr/lib/libglib-2.0.so.0+0x53631)
#2 0x563fdbbb98c7 in init_test /home/smarchi/src/babeltrace/tests/lib/test_graph_topo.c:330
#3 0x563fdbbb98c7 in main /home/smarchi/src/babeltrace/tests/lib/test_graph_topo.c:711
#4 0x7fc88d19d78f (/usr/lib/libc.so.6+0x2378f)
For some reason, that leak does not show up on a -O0 build. Anyhow,
call BT_MESSAGE_ITERATOR_CLASS_PUT_REF_AND_RESET, it's the right thing
to do to clean things up.
Change-Id: I875d8961c2eb4915fbc13706b9148151e82e26d8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/9626
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.02507 seconds and 4 git commands to generate.