From 9753290f339f4e2d06d11c32b62577827fe44aab Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 9 Oct 2015 22:47:55 +0200 Subject: [PATCH] Fix a memory leak when retrying outgoing connections. When retry_outgoing_handler() calls setup_outgoing_connection(), it can be that the old configuration is still in memory. So clean that up before reading in new configuration data. --- src/net_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net_socket.c b/src/net_socket.c index 55e7d315..06394781 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -522,6 +522,7 @@ void setup_outgoing_connection(meshlink_handle_t *mesh, outgoing_t *outgoing) { return; } + exit_configuration(&outgoing->config_tree); // discard old configuration if present init_configuration(&outgoing->config_tree); read_host_config(mesh, outgoing->config_tree, outgoing->name); outgoing->cfg = lookup_config(outgoing->config_tree, "Address"); -- 2.39.5