X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.c;h=a4bff6d99fe4c0bd8ca6b9f7af115fb4d6fe3953;hb=50ad3f2a895c38f8d546f87490ca96ab7d9e011e;hp=2c7cc55a7813b7326d9875e65c9e153a8a373a83;hpb=bc0a24ec810cb911610ae7aafa245e47d1268cd2;p=tinc diff --git a/src/net.c b/src/net.c index 2c7cc55a..a4bff6d9 100644 --- a/src/net.c +++ b/src/net.c @@ -121,8 +121,6 @@ void terminate_connection(connection_t *c, bool report) { if(c->socket) closesocket(c->socket); - event_del(&c->ev); - if(c->edge) { if(report && !tunnelserver) send_del_edge(broadcast, c->edge); @@ -146,12 +144,6 @@ void terminate_connection(connection_t *c, bool report) { } } - free(c->outbuf); - c->outbuf = NULL; - c->outbuflen = 0; - c->outbufsize = 0; - c->outbufstart = 0; - /* Check if this was our outgoing connection */ if(c->outgoing) @@ -280,7 +272,7 @@ static void sigwinch_handler(int signal, short events, void *data) { static void sighup_handler(int signal, short events, void *data) { connection_t *c; - splay_node_t *node; + splay_node_t *node, *next; char *fname; struct stat s; static time_t last_config_check = 0; @@ -300,8 +292,9 @@ static void sighup_handler(int signal, short events, void *data) { /* Close connections to hosts that have a changed or deleted host config file */ - for(node = connection_tree->head; node; node = node->next) { + for(node = connection_tree->head; node; node = next) { c = node->data; + next = node->next; if(c->outgoing) { free(c->outgoing->name);