From c082e5d3fcbf12d2e032497dbfdcdb0beb859519 Mon Sep 17 00:00:00 2001 From: Holger Arnold Date: Fri, 6 Dec 2024 11:14:28 +0100 Subject: [PATCH] internal.c: Fix memory leak in HashSkeData The original code did never free the digest buffer. --- src/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 10e5867b6b..47d966ca23 100644 --- a/src/internal.c +++ b/src/internal.c @@ -29851,7 +29851,7 @@ static int HashSkeData(WOLFSSL* ssl, enum wc_HashType hashType, ssl->buffers.digest.length = (unsigned int)digest_sz; /* buffer for hash */ - if (!ssl->buffers.digest.buffer) { + if (ssl->buffers.digest.buffer) { if (!ssl->options.dontFreeDigest) { XFREE(ssl->buffers.digest.buffer, ssl->heap, DYNAMIC_TYPE_DIGEST);