From: Carie Pointer Date: Fri, 20 Jul 2018 20:00:09 +0000 (-0700) Subject: wolfSSL/CyaSSL: Fix memory leak in Curl_cyassl_random X-Git-Tag: curl-7_61_1~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10d8f3f1344b958a9bea3b3d9f607bc624bce410;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c index 0e940487a0..e10398ac3f 100644 --- a/lib/vtls/cyassl.c +++ b/lib/vtls/cyassl.c @@ -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; }