From: Jérémie Galarneau Date: Mon, 28 Oct 2019 20:53:48 +0000 (-0400) Subject: Fix: relayd: don't put un-acquired trace chunk reference X-Git-Tag: v2.12.0-rc1~272 X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=317eadef3cb6e74992824cad4c1193b6dc1e9fdf Fix: relayd: don't put un-acquired trace chunk reference 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 --- 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: