From: Jonathan Rajotte Date: Tue, 1 Mar 2022 19:23:52 +0000 (-0500) Subject: Fix: sessiond: lttng_channel object is not reclaimed X-Git-Tag: v2.12.9~21 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d9a1fd3e4a81c4d74ee555401fa18e4bb21f21ee;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 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;