Fix: reception buffer of control connection is leaked
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 23 Jul 2019 20:45:48 +0000 (16:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:14 +0000 (16:39 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/connection.c

index eeaa0a559c74d3f7aa1ee6d5ffdfa146498ec195..cf93fb6e7ba93df52b548ace622c2387eea43c97 100644 (file)
@@ -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);
 }
 
This page took 0.025755 seconds and 4 git commands to generate.