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)
This commit is contained in:
Bernd Edlinger 2023-12-03 11:34:37 +01:00 committed by Tomas Mraz
parent 3457a550c6
commit ba4d833f6e
1 changed files with 2 additions and 1 deletions

View File

@ -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++;
}