From 10d8f3f1344b958a9bea3b3d9f607bc624bce410 Mon Sep 17 00:00:00 2001 From: Carie Pointer Date: Fri, 20 Jul 2018 13:00:09 -0700 Subject: 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 --- lib/vtls/cyassl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/vtls/cyassl.c') diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c index 0e940487a..e10398ac3 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; } -- cgit v1.2.3