diff options
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms_lib.c | 3 | ||||
-rw-r--r-- | crypto/cms/cms_sd.c | 3 | ||||
-rw-r--r-- | crypto/cms/cms_smime.c | 8 |
3 files changed, 5 insertions, 9 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 7e1c1e8d94..6d2a0e8275 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -354,8 +354,7 @@ BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm) } return mdbio; err: - if (mdbio) - BIO_free(mdbio); + BIO_free(mdbio); return NULL; } diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index b8ed1a1bea..c45d30eac1 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -806,8 +806,7 @@ BIO *cms_SignedData_init_bio(CMS_ContentInfo *cms) } return chain; err: - if (chain) - BIO_free_all(chain); + BIO_free_all(chain); return NULL; } diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 6f6f20d63a..f491ec9e77 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -114,7 +114,7 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags) r = 1; err: - if (tmpout && (tmpout != out)) + if (tmpout != out) BIO_free(tmpout); return r; @@ -446,14 +446,13 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, if (tmpin != dcont) BIO_free(tmpin); } else { - if (dcont && (tmpin == dcont)) do_free_upto(cmsbio, dcont); else BIO_free_all(cmsbio); } - if (tmpout && out != tmpout) + if (out != tmpout) BIO_free_all(tmpout); if (cms_certs) @@ -580,8 +579,7 @@ CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, r = 1; err: - if (rct_cont) - BIO_free(rct_cont); + BIO_free(rct_cont); if (r) return cms; CMS_ContentInfo_free(cms); |