From 75d63071df31143ccc25176535a67518cda214ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Frauenschl=C3=A4ger?= Date: Fri, 7 Feb 2025 16:11:19 +0100 Subject: [PATCH] Fix memory leak in handshake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure peer dilithium keys are properly freed. Signed-off-by: Tobias Frauenschläger --- src/internal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/internal.c b/src/internal.c index c7f482337..86ba579fd 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8906,6 +8906,10 @@ void FreeHandshakeResources(WOLFSSL* ssl) FreeKey(ssl, DYNAMIC_TYPE_FALCON, (void**)&ssl->peerFalconKey); ssl->peerFalconKeyPresent = 0; #endif /* HAVE_FALCON */ +#if defined(HAVE_DILITHIUM) + FreeKey(ssl, DYNAMIC_TYPE_DILITHIUM, (void**)&ssl->peerDilithiumKey); + ssl->peerDilithiumKeyPresent = 0; +#endif /* HAVE_DILITHIUM */ } #ifdef HAVE_ECC