scan-build fixes

This commit is contained in:
Jacob Barthelmeh
2019-07-03 17:08:02 -06:00
parent 0b5ee1b633
commit 5dcd421580
2 changed files with 10 additions and 3 deletions

View File

@@ -8555,6 +8555,10 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert)
x509->pkCurveOID = dCert->pkCurveOID;
#endif /* HAVE_ECC */
if (ret != 0) {
wolfSSL_X509_free(x509);
}
return ret;
}
@@ -9366,6 +9370,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
if (args->dCert == NULL) {
ERROR_OUT(MEMORY_E, exit_ppc);
}
XMEMSET(args->dCert, 0, sizeof(DecodedCert));
#endif
/* Advance state and proceed */

View File

@@ -11120,12 +11120,14 @@ int wc_PKCS7_DecodeEncryptedData(PKCS7* pkcs7, byte* in, word32 inSz,
}
/* decrypt encryptedContent */
ret = wc_PKCS7_DecryptContent(encOID, pkcs7->encryptionKey,
if (ret == 0) {
ret = wc_PKCS7_DecryptContent(encOID, pkcs7->encryptionKey,
pkcs7->encryptionKeySz, tmpIv, expBlockSz,
NULL, 0, NULL, 0, encryptedContent,
encryptedContentSz, encryptedContent);
if (ret != 0) {
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
if (ret != 0) {
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
}
}
if (ret == 0) {