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:40 +0100
commit03e6213d732c5cdeaa0822eeb457d6da3e306718 (patch)
treee57be0b68a8e73b3bd64201b0c87c864e60e3c4c /apps
parentdfe320772d2750b40f9fafe30639fa72f4c823eb (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++;
}