summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCarie Pointer <carie@wolfssl.com>2018-07-20 13:00:09 -0700
committerDaniel Stenberg <daniel@haxx.se>2018-07-26 16:21:59 +0200
commit10d8f3f1344b958a9bea3b3d9f607bc624bce410 (patch)
tree9f4bc6f9ae608b5b5a29196e365b384884dd1ac6 /lib
parenta7091ba75d820612ec260da805e9148397eddfcd (diff)
downloadcurl-10d8f3f1344b958a9bea3b3d9f607bc624bce410.tar.gz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/vtls/cyassl.c2
1 files changed, 2 insertions, 0 deletions
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;
}