X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fconnection.c;h=5cd7a747e6c9bbcbeda0648ee73b6ac3ea1f460d;hb=531d5a904a3a91bca8b7d373fb6ab2869b31e7fa;hp=1f2f96cc0aca244fda4bf71d31e9d8f13f6a4bd4;hpb=38c25d62c2bc76908bd95fb21c8f5e39ad269884;p=tinc diff --git a/src/connection.c b/src/connection.c index 1f2f96cc..5cd7a747 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 @@ -79,15 +79,28 @@ void free_connection(connection_t *c) { cp(); - if(c) { + if(!c) + return; + + if(c->name) + free(c->name); + + if(c->hostname) free(c->hostname); + + if(c->inkey) free(c->inkey); + + if(c->outkey) free(c->outkey); + + if(c->mychallenge) free(c->mychallenge); + + if(c->hischallenge) free(c->hischallenge); - event_del(&c->ev); - } + event_del(&c->ev); free(c); }