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:07 +0100
commitba4d833f6e24a83bc3e74ba55f52d8916b70fb59 (patch)
treeab6f6e9294c9db23e194953ab194ff4e227c49a2 /apps
parent3457a550c64ab8009c7cd0175675ac140cab33c2 (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)
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 88b0475d2d..b59e14b0b5 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -484,7 +484,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++;
}