(EC)DH memory handling fixes.

Submitted by: Adam Langley
This commit is contained in:
Bodo Möller
2011-09-05 10:25:21 +00:00
parent 8eaf563c41
commit e935440ad7
4 changed files with 30 additions and 9 deletions

View File

@@ -2198,11 +2198,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;