(EC)DH memory handling fixes.

Submitted by: Adam Langley
This commit is contained in:
Bodo Möller
2011-09-05 10:25:27 +00:00
parent 7f1022a8b1
commit 61ac68f9f6
4 changed files with 30 additions and 9 deletions

View File

@@ -3021,11 +3021,17 @@ void ssl3_clear(SSL *s)
}
#ifndef OPENSSL_NO_DH
if (s->s3->tmp.dh != NULL)
{
DH_free(s->s3->tmp.dh);
s->s3->tmp.dh = NULL;
}
#endif
#ifndef OPENSSL_NO_ECDH
if (s->s3->tmp.ecdh != NULL)
{
EC_KEY_free(s->s3->tmp.ecdh);
s->s3->tmp.ecdh = NULL;
}
#endif
rp = s->s3->rbuf.buf;