Fix: relayd: don't put un-acquired trace chunk reference
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 28 Oct 2019 20:53:48 +0000 (16:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 29 Oct 2019 04:01:51 +0000 (00:01 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/stream.c

index 3c61e3532e1fd2b810b278f9cb9c5c98391444af..94698f8d868e4da4d3e04770429a0ccfe40f3b7a 100644 (file)
@@ -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:
This page took 0.033692 seconds and 4 git commands to generate.