From d9a1fd3e4a81c4d74ee555401fa18e4bb21f21ee Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 1 Mar 2022 14:23:52 -0500 Subject: [PATCH] Fix: sessiond: lttng_channel object is not reclaimed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The reclaim is also missing on the error path. Reported by Coverity: CID 1475807: Resource leak (RESOURCE_LEAK) Variable channel going out of scope leaks the storage it points to. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I9ae59900f6bc33282b8b8a65b834a718428a7f50 --- src/bin/lttng-sessiond/cmd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 51b73bc4e..1b0270e31 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3805,6 +3805,7 @@ enum lttng_error_code cmd_list_channels(enum lttng_domain_type domain, extended->lost_packets = lost_packets; ret = lttng_channel_serialize(channel, buffer); + lttng_channel_destroy(channel); if (ret) { ret = -1; break; -- 2.34.1