Fix: release reference to created chunk if it can't be published
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Sep 2019 15:00:30 +0000 (11:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Sep 2019 15:02:31 +0000 (11:02 -0400)
The reference to a trace chunk created in
lttng_consumer_create_trace_chunk() should be dropped if it can't be
published. Failing to do so results in a leak.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer/consumer.c

index 716b560a96ddbf9cd397147fe3ed01eb076781ad..322492631af40f22a8833224032fbc871f88cb34 100644 (file)
@@ -4633,6 +4633,7 @@ error:
        rcu_read_unlock();
        /* Release the reference returned by the "publish" operation. */
        lttng_trace_chunk_put(published_chunk);
+       lttng_trace_chunk_put(created_chunk);
 end:
        return ret_code;
 }
This page took 0.035039 seconds and 4 git commands to generate.