From 8d85ab964d8927898b32cef21ebf39e6860b56d4 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 8 Jan 2025 13:39:33 -0600 Subject: [PATCH] wolfcrypt/src/pkcs12.c: fix resource leak in PKCS12_CoalesceOctetStrings(). --- wolfcrypt/src/pkcs12.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/pkcs12.c b/wolfcrypt/src/pkcs12.c index 5a166c0bc1..f28e23b8bd 100644 --- a/wolfcrypt/src/pkcs12.c +++ b/wolfcrypt/src/pkcs12.c @@ -1277,11 +1277,11 @@ static int PKCS12_CoalesceOctetStrings(WC_PKCS12* pkcs12, byte* data, if (mergedSz > 0) { /* Copy over concatenated octet strings into data buffer */ XMEMCPY(&data[*idx], mergedData, mergedSz); - - XFREE(mergedData, pkcs12->heap, DYNAMIC_TYPE_PKCS); } } + XFREE(mergedData, pkcs12->heap, DYNAMIC_TYPE_PKCS); + return ret; } #endif