From: Jérémie Galarneau Date: Tue, 23 Jul 2019 20:45:48 +0000 (-0400) Subject: Fix: reception buffer of control connection is leaked X-Git-Tag: v2.12.0-rc1~527 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=35be817a5049575ed3169e12d840c44527a6f098;ds=sidebyside Fix: reception buffer of control connection is leaked 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 --- 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); }