relayd: move viewer stream chunk reference release to destroy
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 17:47:08 +0000 (13:47 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 18:33:21 +0000 (14:33 -0400)
Move the viewer stream's release of its trace chunk to the destroy
method (as opposed to the release method) as destroy is used directly
when an error occurs in the viewer stream's creation function.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/viewer-stream.c

index 21294d1f32dfc700c33c1075b1343e36b84c2833..70cd1cea15c13c27823c7555383d37f26f07cae9 100644 (file)
@@ -27,6 +27,7 @@
 
 static void viewer_stream_destroy(struct relay_viewer_stream *vstream)
 {
+       lttng_trace_chunk_put(vstream->stream_file.trace_chunk);
        free(vstream->path_name);
        free(vstream->channel_name);
        free(vstream);
@@ -205,7 +206,7 @@ static void viewer_stream_release(struct urcu_ref *ref)
                stream_put(vstream->stream);
                vstream->stream = NULL;
        }
-       lttng_trace_chunk_put(vstream->stream_file.trace_chunk);
+
        call_rcu(&vstream->rcu_node, viewer_stream_destroy_rcu);
 }
 
This page took 0.03392 seconds and 4 git commands to generate.