From d3f4cf59ca917386e7c6358a98adbe3b8e9ce87a Mon Sep 17 00:00:00 2001 From: Sven-Haegar Koch Date: Sat, 21 Apr 2012 01:59:01 +0200 Subject: [PATCH] free_connection_partially(): Avoid possible use-after-free for c->hischallenge --- src/connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.5