X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fconnection.c;h=7fbb0fc03a177ebc1823b0cc0afdf12653f56a0a;hb=4d440336c3ce68719e23b2fc51fac368e23352ad;hp=fecb48d42d141d37a1830e039fd91e8d629736d9;hpb=886a6f61a1f4cc48a77b42d10f34f9126377d904;p=tinc diff --git a/src/connection.c b/src/connection.c index fecb48d4..7fbb0fc0 100644 --- a/src/connection.c +++ b/src/connection.c @@ -75,12 +75,15 @@ void free_connection(connection_t *c) { if(c->config_tree) exit_configuration(&c->config_tree); - if(c->buffer) - bufferevent_free(c->buffer); + buffer_clear(&c->inbuf); + buffer_clear(&c->outbuf); if(event_initialized(&c->inevent)) event_del(&c->inevent); + if(event_initialized(&c->outevent)) + event_del(&c->outevent); + free(c); }