From: Jonathan Rajotte Date: Tue, 1 Mar 2022 15:31:33 +0000 (-0500) Subject: Fix: sessiond: lttng_channel object is not reclaimed X-Git-Tag: v2.13.5~30 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cfb1642dfc940ec63ec86e0721f0f5cdf5a79fe7;p=lttng-tools.git Fix: sessiond: lttng_channel object is not reclaimed 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 --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index cf6764d61..3fa56a57e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3786,6 +3786,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);