Fix: action-executor: leak of `work_item::subitems` field
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 7 May 2021 21:44:52 +0000 (17:44 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 10 May 2021 19:05:26 +0000 (15:05 -0400)
This leak can be reproduced by adding a trigger and looking at the used
memory of the lttng-sessiond process.

Valgrind reports the following leak:
  ==2472== 7,087,968 bytes in 147,666 blocks are definitely lost in loss record 24 of 24
  ==2472==    at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==2472==    by 0x191C37: zmalloc (macros.h:45)
  ==2472==    by 0x195234: action_executor_enqueue_trigger (action-executor.c:913)
  ==2472==    by 0x171AD7: dispatch_one_event_notifier_notification (notification-thread-events.c:4626)
  ==2472==    by 0x171D1E: handle_one_event_notifier_notification (notification-thread-events.c:4715)
  ==2472==    by 0x171DA4: handle_notification_thread_event_notification (notification-thread-events.c:4730)
  ==2472==    by 0x164EA6: handle_event_notification_pipe (notification-thread.c:591)
  ==2472==    by 0x1656C3: thread_notification (notification-thread.c:727)
  ==2472==    by 0x17BD16: launch_thread (thread.c:66)
  ==2472==    by 0x5F086DA: start_thread (pthread_create.c:463)
  ==2472==    by 0x624188E: clone (clone.S:95)

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3d98e3ae18c5b2d7f400407842a7de17716f680c

src/bin/lttng-sessiond/action-executor.c

index a259933521517c358bd2ab2aa9be32b53c1f8756..853146d3b8b3bb6f77c3788cecfb2fa280f0409a 100644 (file)
@@ -730,6 +730,7 @@ static void action_work_item_destroy(struct action_work_item *work_item)
        lttng_evaluation_destroy(work_item->evaluation);
        notification_client_list_put(work_item->client_list);
        lttng_dynamic_array_reset(work_item->subitems);
+       free(work_item->subitems);
        free(work_item);
 }
 
This page took 0.027829 seconds and 5 git commands to generate.