From 5cb5ab34124beec4cb236832adce72e5b22e53cf Mon Sep 17 00:00:00 2001 From: thorkill Date: Thu, 9 Jul 2015 01:04:57 +0200 Subject: [PATCH] Fix memory leak in setup_outgoing_connection Do not allocate new configuration for outgoing connection if it's already initialized. --- src/net_socket.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/net_socket.c b/src/net_socket.c index b89412d7..388d8ad1 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -609,9 +609,11 @@ void setup_outgoing_connection(outgoing_t *outgoing) { return; } - init_configuration(&outgoing->config_tree); - read_host_config(outgoing->config_tree, outgoing->name); - outgoing->cfg = lookup_config(outgoing->config_tree, "Address"); + if (!outgoing->config_tree) { + init_configuration(&outgoing->config_tree); + read_host_config(outgoing->config_tree, outgoing->name); + outgoing->cfg = lookup_config(outgoing->config_tree, "Address"); + } if(!outgoing->cfg) { if(n)