X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fconnection.c;h=1f2f96cc0aca244fda4bf71d31e9d8f13f6a4bd4;hb=38c25d62c2bc76908bd95fb21c8f5e39ad269884;hp=c4c9fd4861a530f8b2c3e63a950f0b43ce50cb1a;hpb=834290b00f859412ee48bef454a07083cb727130;p=tinc diff --git a/src/connection.c b/src/connection.c index c4c9fd48..1f2f96cc 100644 --- a/src/connection.c +++ b/src/connection.c @@ -70,6 +70,7 @@ connection_t *new_connection(void) return NULL; gettimeofday(&c->start, NULL); + event_set(&c->ev, -1, 0, NULL, NULL); return c; } @@ -78,20 +79,14 @@ void free_connection(connection_t *c) { cp(); - if(c->hostname) + if(c) { 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); + } free(c); }