forked from wolfSSL/wolfssl
Fix writedup rng leak
This commit is contained in:
@ -7934,6 +7934,8 @@ void SSL_ResourceFree(WOLFSSL* ssl)
|
|||||||
if (ssl->options.weOwnRng) {
|
if (ssl->options.weOwnRng) {
|
||||||
wc_FreeRng(ssl->rng);
|
wc_FreeRng(ssl->rng);
|
||||||
XFREE(ssl->rng, ssl->heap, DYNAMIC_TYPE_RNG);
|
XFREE(ssl->rng, ssl->heap, DYNAMIC_TYPE_RNG);
|
||||||
|
ssl->rng = NULL;
|
||||||
|
ssl->options.weOwnRng = 0;
|
||||||
}
|
}
|
||||||
FreeSuites(ssl);
|
FreeSuites(ssl);
|
||||||
FreeHandshakeHashes(ssl);
|
FreeHandshakeHashes(ssl);
|
||||||
|
@ -1563,6 +1563,13 @@ static int DupSSL(WOLFSSL* dup, WOLFSSL* ssl)
|
|||||||
ssl->dupWrite->dupCount = 2; /* both sides have a count to start */
|
ssl->dupWrite->dupCount = 2; /* both sides have a count to start */
|
||||||
dup->dupWrite = ssl->dupWrite; /* each side uses */
|
dup->dupWrite = ssl->dupWrite; /* each side uses */
|
||||||
|
|
||||||
|
if (dup->options.weOwnRng) {
|
||||||
|
wc_FreeRng(dup->rng);
|
||||||
|
XFREE(dup->rng, dup->heap, DYNAMIC_TYPE_RNG);
|
||||||
|
dup->rng = NULL;
|
||||||
|
dup->options.weOwnRng = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* copy write parts over to dup writer */
|
/* copy write parts over to dup writer */
|
||||||
XMEMCPY(&dup->specs, &ssl->specs, sizeof(CipherSpecs));
|
XMEMCPY(&dup->specs, &ssl->specs, sizeof(CipherSpecs));
|
||||||
XMEMCPY(&dup->options, &ssl->options, sizeof(Options));
|
XMEMCPY(&dup->options, &ssl->options, sizeof(Options));
|
||||||
|
Reference in New Issue
Block a user