mirror of https://github.com/openssl/openssl.git
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)
(cherry picked from commit 3457a550c6)
This commit is contained in:
parent
ed5f9ce63e
commit
dfe320772d
|
|
@ -620,7 +620,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();
|
||||
|
|
@ -831,7 +832,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…
Reference in New Issue