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.12.0-rc1~427 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=9bb5f1f8c4f1aeaca00ebbca40fc145dc4c7ee52 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; }