]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mbedtls: free the entropy when threaded
authorDaniel Stenberg <daniel@haxx.se>
Fri, 22 Dec 2023 09:16:14 +0000 (10:16 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Dec 2023 09:58:07 +0000 (10:58 +0100)
The entropy_free was never done for threaded builds, causing a small
(fixed) memory leak.

Reported-by: RevaliQaQ on github
Fixes #12584
Closes #12585

lib/vtls/mbedtls.c

index 4734ce026a2278ab64a2b6780bfff4735a04cc83..159fa6c6667013b99ada27573803c752e62ebe85 100644 (file)
@@ -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();
 }