1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

wolfSSL/CyaSSL: Fix memory leak in Curl_cyassl_random

RNG structure must be freed by call to FreeRng after its use in
Curl_cyassl_random. This call fixes Valgrind failures when running the
test suite with wolfSSL.

Closes #2784
This commit is contained in:
Carie Pointer 2018-07-20 13:00:09 -07:00 committed by Daniel Stenberg
parent a7091ba75d
commit 10d8f3f134
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -968,6 +968,8 @@ static CURLcode Curl_cyassl_random(struct Curl_easy *data,
return CURLE_FAILED_INIT;
if(RNG_GenerateBlock(&rng, entropy, (unsigned)length))
return CURLE_FAILED_INIT;
if(FreeRng(&rng))
return CURLE_FAILED_INIT;
return CURLE_OK;
}