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

View File

@@ -11120,6 +11120,7 @@ int wc_PKCS7_DecodeEncryptedData(PKCS7* pkcs7, byte* in, word32 inSz,
} }
/* decrypt encryptedContent */ /* decrypt encryptedContent */
if (ret == 0) {
ret = wc_PKCS7_DecryptContent(encOID, pkcs7->encryptionKey, ret = wc_PKCS7_DecryptContent(encOID, pkcs7->encryptionKey,
pkcs7->encryptionKeySz, tmpIv, expBlockSz, pkcs7->encryptionKeySz, tmpIv, expBlockSz,
NULL, 0, NULL, 0, encryptedContent, NULL, 0, NULL, 0, encryptedContent,
@@ -11127,6 +11128,7 @@ int wc_PKCS7_DecodeEncryptedData(PKCS7* pkcs7, byte* in, word32 inSz,
if (ret != 0) { if (ret != 0) {
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7); XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
} }
}
if (ret == 0) { if (ret == 0) {
padLen = encryptedContent[encryptedContentSz-1]; padLen = encryptedContent[encryptedContentSz-1];