X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet_setup.c;h=c413792abbe07def1b38bc7f8fac06f02edfe175;hb=503c32eb0ef9d6329e931559082f4ddf6d487dc6;hp=f4246db25984e6a89ea19e12916bffdfca35e09b;hpb=0e4d419aae8a82f2ae4552f755894a9bc70c83d2;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index f4246db2..c413792a 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -571,21 +571,16 @@ void close_network_connections(void) for(node = connection_tree->head; node; node = next) { next = node->next; c = node->data; - - if(c->outgoing) { - if(c->outgoing->ai) - freeaddrinfo(c->outgoing->ai); - free(c->outgoing->name); - free(c->outgoing); - c->outgoing = NULL; - } - + c->outgoing = false; terminate_connection(c, false); } + list_delete_list(outgoing_list); + if(myself && myself->connection) { subnet_update(myself, NULL, false); terminate_connection(myself->connection, false); + free_connection(myself->connection); } for(i = 0; i < listen_sockets; i++) { @@ -608,6 +603,10 @@ void close_network_connections(void) execute_script("tinc-down", envp); + if(myport) free(myport); + + EVP_CIPHER_CTX_cleanup(&packet_ctx); + for(i = 0; i < 4; i++) free(envp[i]);