X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconnection.c;h=38b3ccfe1b91c675fd5e7783b89474a5c2778c67;hp=46b11c8546dce5aafc11c99ea79b461b07144656;hb=3fae14fae5a347823679ef694ab630b4991a201d;hpb=985d19caf20058db3c764f0f6fbeafa8bcc59fcc;ds=sidebyside diff --git a/src/connection.c b/src/connection.c index 46b11c85..38b3ccfe 100644 --- a/src/connection.c +++ b/src/connection.c @@ -28,7 +28,7 @@ #include "utils.h" #include "xalloc.h" -avl_tree_t *connection_tree; /* Meta connections */ +avl_tree_t *connection_tree; /* Meta connections */ connection_t *everyone; static int connection_compare(const connection_t *a, const connection_t *b) { @@ -52,8 +52,9 @@ connection_t *new_connection(void) { c = xmalloc_and_zero(sizeof(connection_t)); - if(!c) + if(!c) { return NULL; + } gettimeofday(&c->start, NULL); @@ -118,8 +119,9 @@ void free_connection(connection_t *c) { free(c->name); free(c->hostname); - if(c->config_tree) + if(c->config_tree) { exit_configuration(&c->config_tree); + } free(c); } @@ -141,8 +143,8 @@ void dump_connections(void) { for(node = connection_tree->head; node; node = node->next) { c = node->data; logger(LOG_DEBUG, " %s at %s options %x socket %d status %04x outbuf %d/%d/%d", - c->name, c->hostname, c->options, c->socket, bitfield_to_int(&c->status, sizeof(c->status)), - c->outbufsize, c->outbufstart, c->outbuflen); + c->name, c->hostname, c->options, c->socket, bitfield_to_int(&c->status, sizeof(c->status)), + c->outbufsize, c->outbufstart, c->outbuflen); } logger(LOG_DEBUG, "End of connections.");