Fix: sessiond: lttng_channel object is not reclaimed
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 1 Mar 2022 15:31:33 +0000 (10:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Mar 2022 19:12:32 +0000 (14:12 -0500)
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9ae59900f6bc33282b8b8a65b834a718428a7f50

src/bin/lttng-sessiond/cmd.cpp

index 659e389b29df286c1d3c7dab2049ce7b5909a48d..2682629bbbbe91d2a89b6e40178fa0c6ec74bac3 100644 (file)
@@ -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);
This page took 0.029196 seconds and 5 git commands to generate.