Fix: memory leak of client_list_element
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 18:31:22 +0000 (14:31 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:55:05 +0000 (15:55 -0400)
Reported-by: Coverity Scan
CID 1374799:  Resource leaks  (RESOURCE_LEAK)
Variable "client_list_element" going out of scope leaks the storage
it points to.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/notification-thread-events.c

index 00a2bf66f559f1d5b8d6ee2c019e3dd0c2241534..8bc020f960f24f691c6e0a44e51aaac6239084c7 100644 (file)
@@ -405,6 +405,7 @@ int notification_thread_client_subscribe(struct notification_client *client,
                        &iter);
        node = cds_lfht_iter_get_node(&iter);
        if (!node) {
+               free(client_list_element);
                goto end_unlock;
        }
 
This page took 0.027402 seconds and 4 git commands to generate.