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>
Fri, 9 Aug 2019 15:28:43 +0000 (11:28 -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.034201 seconds and 4 git commands to generate.