free_connection_partially(): Avoid possible use-after-free for c->hischallenge

This commit is contained in:
Sven-Haegar Koch 2012-04-21 01:59:01 +02:00 committed by Guus Sliepen
parent 7a6ca7a993
commit d3f4cf59ca

View file

@ -64,8 +64,10 @@ void free_connection_partially(connection_t *c) {
ecdsa_free(&c->ecdsa); ecdsa_free(&c->ecdsa);
rsa_free(&c->rsa); rsa_free(&c->rsa);
if(c->hischallenge) if(c->hischallenge) {
free(c->hischallenge); free(c->hischallenge);
c->hischallenge = NULL;
}
buffer_clear(&c->inbuf); buffer_clear(&c->inbuf);
buffer_clear(&c->outbuf); buffer_clear(&c->outbuf);