[lttng-dev] [PATCH lttng-tools] Fix: put viewer stream on send error

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Fri Sep 4 12:03:36 EDT 2015


Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 src/bin/lttng-relayd/live.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c
index bcc4045..a1fbbbe 100644
--- a/src/bin/lttng-relayd/live.c
+++ b/src/bin/lttng-relayd/live.c
@@ -243,10 +243,10 @@ ssize_t send_viewer_streams(struct lttcomm_sock *sock,
 		pthread_mutex_unlock(&vstream->stream->lock);
 
 		ret = send_response(sock, &send_stream, sizeof(send_stream));
+		viewer_stream_put(vstream);
 		if (ret < 0) {
 			goto end_unlock;
 		}
-		viewer_stream_put(vstream);
 	}
 
 	ret = 0;
-- 
2.1.4




More information about the lttng-dev mailing list