summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2023-12-03 11:34:37 +0100
committerTomas Mraz <tomas@openssl.org>2023-12-12 19:47:51 +0100
commit4883f4b5315ac1656c58f4ba35dfcd3765bfd745 (patch)
treed1804a6072627189fba734510ffec468f8a0528d /apps
parent98c9595ca63115341d401d7fb62cf21058ad1a60 (diff)
Fix a possible memleak in smime_main
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22919) (cherry picked from commit ba4d833f6e24a83bc3e74ba55f52d8916b70fb59)
Diffstat (limited to 'apps')
-rw-r--r--apps/smime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/smime.c b/apps/smime.c
index a2ff0b5be7..52b4a01c23 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -453,7 +453,8 @@ int smime_main(int argc, char **argv)
"recipient certificate file");
if (cert == NULL)
goto end;
- sk_X509_push(encerts, cert);
+ if (!sk_X509_push(encerts, cert))
+ goto end;
cert = NULL;
argv++;
}