Fix: sessiond: fix memory leak in receive_lttng_trigger
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 9 Apr 2021 16:04:13 +0000 (12:04 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Apr 2021 20:22:37 +0000 (16:22 -0400)
commitbae46a81520110e52c5af423ce712b9099fe23dd
treea86fbdff85eb8dc345deae3c9be3cfed324cc995
parent5a84371737068dab06d15e8a89f09af939751019
Fix: sessiond: fix memory leak in receive_lttng_trigger

After adding a trigger, ASan reports this when exiting the sessiond:

    Direct leak of 128 byte(s) in 1 object(s) allocated from:
        #0 0x7ffff767783a in __interceptor_realloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:164
        #1 0x55555579a415 in lttng_dynamic_buffer_set_capacity /home/simark/src/lttng-tools/src/common/dynamic-buffer.c:166
#2 0x55555579a1df in lttng_dynamic_buffer_set_size /home/simark/src/lttng-tools/src/common/dynamic-buffer.c:118
        #3 0x5555556d3cc1 in receive_lttng_trigger /home/simark/src/lttng-tools/src/bin/lttng-sessiond/client.c:712
        #4 0x5555556dba46 in process_client_msg /home/simark/src/lttng-tools/src/bin/lttng-sessiond/client.c:2154
        #5 0x5555556deef7 in thread_manage_clients /home/simark/src/lttng-tools/src/bin/lttng-sessiond/client.c:2601
        #6 0x5555556c8a83 in launch_thread /home/simark/src/lttng-tools/src/bin/lttng-sessiond/thread.c:66
        #7 0x7ffff714c298 in start_thread (/usr/lib/libpthread.so.0+0x9298)

It seems like we don't free the payload in receive_lttng_trigger, fix
that.

Change-Id: Ie9bc3bad24fb55b98c8232c0cd63483a3e94bfb0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/client.c
This page took 0.0325 seconds and 4 git commands to generate.