Add missing cleanup functions in close_network_connections().
[tinc] / src / net_setup.c
index f4246db..f52afb0 100644 (file)
@@ -586,6 +586,7 @@ void close_network_connections(void)
        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 +609,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]);