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