From 88b02a8e7cbdbc728cc681cd07bbe0c738964717 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 1 Mar 2022 10:31:33 -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.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-sessiond/cmd.cpp b/src/bin/lttng-sessiond/cmd.cpp index 659e389b2..2682629bb 100644 --- a/src/bin/lttng-sessiond/cmd.cpp +++ b/src/bin/lttng-sessiond/cmd.cpp @@ -3785,6 +3785,7 @@ enum lttng_error_code cmd_list_channels(enum lttng_domain_type domain, ret = lttng_channel_serialize( channel, &payload->buffer); + lttng_channel_destroy(channel); if (ret) { ERR("Failed to serialize lttng_channel: channel name = '%s'", channel->name); -- 2.34.1