From 317eadef3cb6e74992824cad4c1193b6dc1e9fdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 28 Oct 2019 16:53:48 -0400 Subject: [PATCH 1/1] Fix: relayd: don't put un-acquired trace chunk reference MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit stream_create() should not release (put) the reference to the current trace chunk in its error path if it could not acquire a new reference in the first place. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/stream.c b/src/bin/lttng-relayd/stream.c index 3c61e3532..94698f8d8 100644 --- a/src/bin/lttng-relayd/stream.c +++ b/src/bin/lttng-relayd/stream.c @@ -644,7 +644,9 @@ end: stream_put(stream); stream = NULL; } - lttng_trace_chunk_put(current_trace_chunk); + if (acquired_reference) { + lttng_trace_chunk_put(current_trace_chunk); + } return stream; error_no_alloc: -- 2.34.1