From 35be817a5049575ed3169e12d840c44527a6f098 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 23 Jul 2019 16:45:48 -0400 Subject: [PATCH] Fix: reception buffer of control connection is leaked MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The reception buffers of control connections are not "reset" on destruction, resulting in their underlying storage buffer being leaked. The typical (observed) size of the leak is 8kb per control connection. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/connection.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng-relayd/connection.c b/src/bin/lttng-relayd/connection.c index eeaa0a559..cf93fb6e7 100644 --- a/src/bin/lttng-relayd/connection.c +++ b/src/bin/lttng-relayd/connection.c @@ -127,6 +127,10 @@ static void rcu_free_connection(struct rcu_head *head) viewer_session_destroy(conn->viewer_session); conn->viewer_session = NULL; } + if (conn->type == RELAY_CONTROL) { + lttng_dynamic_buffer_reset( + &conn->protocol.ctrl.reception_buffer); + } free(conn); } -- 2.34.1