Tests: fix: schedule api: leak of rotation schedule list
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Apr 2022 05:34:54 +0000 (01:34 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Apr 2022 05:35:30 +0000 (01:35 -0400)
==1769573==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fef37a29fb9 in __interceptor_calloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7fef37792f2f in zmalloc_internal ../../../src/common/macros.hpp:60
    #2 0x7fef3779573a in lttng_rotation_schedules* zmalloc<lttng_rotation_schedules>() ../../../src/common/macros.hpp:89
    #3 0x7fef377947cc in lttng_rotation_schedules_create /home/jgalar/EfficiOS/src/lttng-tools/src/lib/lttng-ctl/rotate.cpp:353
    #4 0x7fef37794aa0 in get_schedules /home/jgalar/EfficiOS/src/lttng-tools/src/lib/lttng-ctl/rotate.cpp:392
    #5 0x7fef377956dc in lttng_session_list_rotation_schedules /home/jgalar/EfficiOS/src/lttng-tools/src/lib/lttng-ctl/rotate.cpp:665
    #6 0x5646131713f2 in test_add_list_remove_schedule /home/jgalar/EfficiOS/src/lttng-tools/tests/regression/tools/rotation/schedule_api.c:252
    #7 0x56461317157b in test_add_list_remove_size_schedule /home/jgalar/EfficiOS/src/lttng-tools/tests/regression/tools/rotation/schedule_api.c:270
    #8 0x564613171680 in main /home/jgalar/EfficiOS/src/lttng-tools/tests/regression/tools/rotation/schedule_api.c:307
    #9 0x7fef373ae30f in __libc_start_call_main (/usr/lib/libc.so.6+0x2d30f)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9b7eb537d158791db76f9a7676ffeb5d4a1f2203

tests/regression/tools/rotation/schedule_api.c

index 61146856379f500d2b3dde2f96897655b21cf0b6..009473893b9fb37e004a5936580c9063f47ef5ea 100644 (file)
@@ -255,7 +255,7 @@ void test_add_list_remove_schedule(
                        &schedules_count);
        ok(status == LTTNG_ROTATION_STATUS_OK && schedules_count == 0,
                        "Listing returned 0 rotation schedules after removal");
-
+       lttng_rotation_schedules_destroy(list_schedules);
 }
 
 static
This page took 0.026854 seconds and 5 git commands to generate.