From: Bernd Edlinger Date: Sun, 3 Dec 2023 10:34:37 +0000 (+0100) Subject: Fix a possible memleak in smime_main X-Git-Tag: openssl-3.1.5~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e6213d732c5cdeaa0822eeb457d6da3e306718;p=thirdparty%2Fopenssl.git Fix a possible memleak in smime_main Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22919) (cherry picked from commit ba4d833f6e24a83bc3e74ba55f52d8916b70fb59) --- diff --git a/apps/smime.c b/apps/smime.c index a2ff0b5be75..52b4a01c232 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++; }