Fix: relayd: don't put un-acquired trace chunk reference
[lttng-tools.git] / src / bin / lttng-relayd / stream.c
index 1b4e38ac8fc2b0c9d209b39ac3a559fe9e284f98..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:
@@ -1052,6 +1054,7 @@ int stream_update_index(struct relay_stream *stream, uint64_t net_seq_num,
        uint64_t data_offset;
        struct relay_index *index;
 
+       assert(stream->trace_chunk);
        ASSERT_LOCKED(stream->lock);
        /* Get data offset because we are about to update the index. */
        data_offset = htobe64(stream->tracefile_size_current);
This page took 0.023033 seconds and 4 git commands to generate.