Fix memory leak in setup_outgoing_connection

Do not allocate new configuration for outgoing connection if it's already initialized.
This commit is contained in:
thorkill 2015-07-09 01:04:57 +02:00
parent 1f2e14df8c
commit 5cb5ab3412

View file

@ -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)