Fix: sessiond: lttng_channel object is not reclaimed
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 1 Mar 2022 19:23:52 +0000 (14:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Mar 2022 19:23:52 +0000 (14:23 -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.c

index 51b73bc4e6d02f22d60163b430f9a16f20fea8fa..1b0270e3147e5640055a7b676f434aa92d6262f9 100644 (file)
@@ -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;
This page took 0.028359 seconds and 4 git commands to generate.