From: Sven-Haegar Koch Date: Fri, 20 Apr 2012 23:59:01 +0000 (+0200) Subject: free_connection_partially(): Avoid possible use-after-free for c->hischallenge X-Git-Tag: import-tinc-1.1~376 X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=d3f4cf59ca917386e7c6358a98adbe3b8e9ce87a free_connection_partially(): Avoid possible use-after-free for c->hischallenge --- diff --git a/src/connection.c b/src/connection.c index dd524486..6fdd2bc4 100644 --- a/src/connection.c +++ b/src/connection.c @@ -64,8 +64,10 @@ void free_connection_partially(connection_t *c) { ecdsa_free(&c->ecdsa); rsa_free(&c->rsa); - if(c->hischallenge) + if(c->hischallenge) { free(c->hischallenge); + c->hischallenge = NULL; + } buffer_clear(&c->inbuf); buffer_clear(&c->outbuf);