From: Jérémie Galarneau Date: Thu, 19 Sep 2019 17:47:08 +0000 (-0400) Subject: relayd: move viewer stream chunk reference release to destroy X-Git-Tag: v2.11.0-rc4~21 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b4324e73c1764ebf2d5d55ecceaa3bc1aaddd412;p=lttng-tools.git relayd: move viewer stream chunk reference release to destroy 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 --- diff --git a/src/bin/lttng-relayd/viewer-stream.c b/src/bin/lttng-relayd/viewer-stream.c index 21294d1f3..70cd1cea1 100644 --- a/src/bin/lttng-relayd/viewer-stream.c +++ b/src/bin/lttng-relayd/viewer-stream.c @@ -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); }