From: Guus Sliepen Date: Mon, 12 Mar 2007 17:55:43 +0000 (+0000) Subject: Only free members of connection_t that have been allocated. X-Git-Tag: import-tinc-1.1~670 X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=3730156165fd1aa7c8810cd8e390aba6a8badcfa Only free members of connection_t that have been allocated. --- diff --git a/src/connection.c b/src/connection.c index 1f2f96cc..b6ce517e 100644 --- a/src/connection.c +++ b/src/connection.c @@ -79,15 +79,25 @@ void free_connection(connection_t *c) { cp(); - if(c) { + if(!c) + return; + + 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); }