Fix for Valgrind memory leak with the “ssl->hsHashes”. The DTLS wolfSSL_connect for “IsDtlsNotSctpMode” at line 8134 calls InitHandshakeHashes, but doesn’t free existing. Best overall solution is to make sure and free an existing on InitHandshakeHashes, since WOLFSSL is memset to 0.

This commit is contained in:
David Garske
2017-04-27 13:23:33 -07:00
parent 758c2a761c
commit af0103bc94

View File

@@ -3399,6 +3399,12 @@ int InitHandshakeHashes(WOLFSSL* ssl)
{
int ret;
/* make sure existing handshake hashes are free'd */
if (ssl->hsHashes != NULL) {
FreeHandshakeHashes(ssl);
}
/* allocate handshake hashes */
ssl->hsHashes = (HS_Hashes*)XMALLOC(sizeof(HS_Hashes), ssl->heap,
DYNAMIC_TYPE_HASHES);
if (ssl->hsHashes == NULL) {