mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-03-07 00:14:05 +01:00
Memory allocation failure testing fixes
Fixes for test code to cleanup on failure properly. pkcs7.c: when streaming, free the decrypting content when adding data to the stream fails.
This commit is contained in:
@@ -12659,8 +12659,13 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(wc_PKCS7* pkcs7, byte* in,
|
||||
case WC_PKCS7_ENV_5:
|
||||
|
||||
#ifndef NO_PKCS7_STREAM
|
||||
|
||||
if ((ret = wc_PKCS7_AddDataToStream(pkcs7, in, inSz,
|
||||
pkcs7->stream->expected, &pkiMsg, &idx)) != 0) {
|
||||
if (ret != WC_NO_ERR_TRACE(WC_PKCS7_WANT_READ_E)) {
|
||||
wc_PKCS7_StreamGetVar(pkcs7, &encOID, NULL, NULL);
|
||||
wc_PKCS7_DecryptContentFree(pkcs7, encOID, pkcs7->heap);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user