From 7fba8407cc72e09dbd8d768100617286b0740b03 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sun, 21 Jun 2015 15:37:53 -0400 Subject: [PATCH] RT3917: add cleanup on an error path Reviewed-by: Richard Levitte --- crypto/cms/cms_smime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 0d97d3e5f3..b33bc1d958 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -386,7 +386,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, tmpin = BIO_new_mem_buf(ptr, len); if (tmpin == NULL) { CMSerr(CMS_F_CMS_VERIFY, ERR_R_MALLOC_FAILURE); - return 0; + goto err2; } } else tmpin = dcont; @@ -455,6 +455,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, if (out != tmpout) BIO_free_all(tmpout); + err2: sk_X509_pop_free(cms_certs, X509_free); sk_X509_CRL_pop_free(crls, X509_CRL_free); -- 2.34.1