From 9bb5f1f8c4f1aeaca00ebbca40fc145dc4c7ee52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 9 Sep 2019 11:00:30 -0400 Subject: [PATCH] Fix: release reference to created chunk if it can't be published MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/consumer/consumer.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.34.1