From: Guus Sliepen Date: Fri, 9 Oct 2015 20:47:55 +0000 (+0200) Subject: Fix a memory leak when retrying outgoing connections. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=9753290f339f4e2d06d11c32b62577827fe44aab 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. --- 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");