X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconnection.c;h=9fd4002ba52a557453c1310b75bdc35fbf5c3a84;hp=c4c9fd4861a530f8b2c3e63a950f0b43ce50cb1a;hb=66be914d35cb7e7ea4dd4aed68ae9e41addd9f70;hpb=eb391c52eed46f3f03b404553df417851fc0cb90 diff --git a/src/connection.c b/src/connection.c index c4c9fd48..9fd4002b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,6 +1,6 @@ /* connection.c -- connection list management - Copyright (C) 2000-2006 Guus Sliepen , + Copyright (C) 2000-2007 Guus Sliepen , 2000-2005 Ivo Timmermans This program is free software; you can redistribute it and/or modify @@ -78,6 +78,9 @@ void free_connection(connection_t *c) { cp(); + if(c->name) + free(c->name); + if(c->hostname) free(c->hostname); @@ -87,12 +90,31 @@ void free_connection(connection_t *c) if(c->outkey) free(c->outkey); + if(c->inctx) { + EVP_CIPHER_CTX_cleanup(c->inctx); + free(c->inctx); + } + + if(c->outctx) { + EVP_CIPHER_CTX_cleanup(c->outctx); + free(c->outctx); + } + if(c->mychallenge) free(c->mychallenge); if(c->hischallenge) free(c->hischallenge); + if(c->config_tree) + exit_configuration(&c->config_tree); + + if(c->outbuf) + free(c->outbuf); + + if(c->rsa_key) + RSA_free(c->rsa_key); + free(c); }