X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconnection.c;h=0e61132c9182a637278b8fe87053962ef23481a8;hp=9c459787eabbb5bc94a200a2dc01e3effbc1be58;hb=abb24e9d71b3edb9cacf4c04361cc0dfd4e6a061;hpb=9b9230a0a79c670b86f54fadd2807b864ff9d91f diff --git a/src/connection.c b/src/connection.c index 9c459787..0e61132c 100644 --- a/src/connection.c +++ b/src/connection.c @@ -48,21 +48,23 @@ void exit_connections(void) { } connection_t *new_connection(void) { - return xmalloc_and_zero(sizeof(connection_t)); + return xzalloc(sizeof(connection_t)); } void free_connection(connection_t *c) { if(!c) return; +#ifndef DISABLE_LEGACY cipher_close(c->incipher); digest_close(c->indigest); cipher_close(c->outcipher); digest_close(c->outdigest); + rsa_free(c->rsa); +#endif sptps_stop(&c->sptps); ecdsa_free(c->ecdsa); - rsa_free(c->rsa); free(c->hischallenge);