Unverified Commit 10d8f3f1 authored by Carie Pointer's avatar Carie Pointer Committed by Daniel Stenberg
Browse files

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
parent a7091ba7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}