X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=f53127b5989085c5753018e8bb4eb9d7f020e503;hp=ccd600b730c41816a49363f0e55464e74cd6f81d;hb=1bb5a284fec8c538f8ba243d4f9b2e46f68cd7e8;hpb=5c69c390a17fc2b37218881e7285b639b79cfc5a diff --git a/src/net_setup.c b/src/net_setup.c index ccd600b7..f53127b5 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -572,8 +572,14 @@ void close_network_connections(void) next = node->next; c = node->data; - if(c->outgoing) - free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL; + if(c->outgoing) { + if(c->outgoing->ai) + freeaddrinfo(c->outgoing->ai); + free(c->outgoing->name); + free(c->outgoing); + c->outgoing = NULL; + } + terminate_connection(c, false); }