mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-10 14:20:53 +02:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user