From: Daniel Stenberg Date: Fri, 22 Dec 2023 09:16:14 +0000 (+0100) Subject: mbedtls: free the entropy when threaded X-Git-Tag: curl-8_6_0~177 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b1d2298;p=thirdparty%2Fcurl.git mbedtls: free the entropy when threaded The entropy_free was never done for threaded builds, causing a small (fixed) memory leak. Reported-by: RevaliQaQ on github Fixes #12584 Closes #12585 --- diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4734ce026a..159fa6c666 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -1206,6 +1206,9 @@ static int mbedtls_init(void) static void mbedtls_cleanup(void) { +#ifdef THREADING_SUPPORT + mbedtls_entropy_free(&ts_entropy); +#endif /* THREADING_SUPPORT */ (void)Curl_mbedtlsthreadlock_thread_cleanup(); }