From 8bbad810c9cab35b3e437cf72b233f57f4b12698 Mon Sep 17 00:00:00 2001 From: Colton Willey Date: Tue, 14 Jul 2026 10:49:38 -0700 Subject: [PATCH] Free FP ECC cache in provider teardown wc_ecc_free() doesn't release wolfCrypt's fixed-point ECC cache; call wc_ecc_fp_free() in wolfssl_prov_ctx_free() (guarded by FP_ECC). --- src/wp_wolfprov.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp_wolfprov.c b/src/wp_wolfprov.c index 675ab62f..34cf1a56 100644 --- a/src/wp_wolfprov.c +++ b/src/wp_wolfprov.c @@ -291,6 +291,10 @@ static void wolfssl_prov_ctx_free(WOLFPROV_CTX* ctx) wc_FreeMutex(&ctx->rng_mutex); #endif wc_FreeRng(&ctx->rng); +#ifdef FP_ECC + /* Free this thread's FP ECC cache; wc_ecc_free() doesn't. */ + wc_ecc_fp_free(); +#endif OPENSSL_free(ctx); }