mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
Fix a possible memleak in cms_main
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22918)
This commit is contained in:
parent
a36d10dfb7
commit
3457a550c6
@ -628,7 +628,8 @@ int cms_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;
|
||||
} else {
|
||||
recipfile = opt_arg();
|
||||
@ -837,7 +838,8 @@ int cms_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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user