Fix possible leak in PKCS for failure case with small stack enabled.

pull/1572/head
David Garske 2018-05-23 16:21:49 -07:00
parent 72d168028e
commit 6f221ff75c
1 changed files with 3 additions and 0 deletions

View File

@ -4186,6 +4186,9 @@ static int wc_PKCS7_DecodeKari(PKCS7* pkcs7, byte* pkiMsg, word32 pkiMsgSz,
pkcs7->privateKeySz);
if (ret != 0) {
wc_PKCS7_KariFree(kari);
#ifdef WOLFSSL_SMALL_STACK
XFREE(encryptedKey, NULL, DYNAMIC_TYPE_PKCS7);
#endif
return ret;
}