From: Jérémie Galarneau Date: Mon, 9 Sep 2019 15:00:30 +0000 (-0400) Subject: Fix: release reference to created chunk if it can't be published X-Git-Tag: v2.11.0-rc4~80 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2519ef55053d651938872d7df86635aa34abd92e;p=lttng-tools.git Fix: release reference to created chunk if it can't be published 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 --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 716b560a9..322492631 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -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; }