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
23acb0d896
commit
e2e2ecd8ba
|
|
@ -628,7 +628,8 @@ int cms_main(int argc, char **argv)
|
||||||
"recipient certificate file");
|
"recipient certificate file");
|
||||||
if (cert == NULL)
|
if (cert == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
sk_X509_push(encerts, cert);
|
if (!sk_X509_push(encerts, cert))
|
||||||
|
goto end;
|
||||||
cert = NULL;
|
cert = NULL;
|
||||||
} else {
|
} else {
|
||||||
recipfile = opt_arg();
|
recipfile = opt_arg();
|
||||||
|
|
@ -837,7 +838,8 @@ int cms_main(int argc, char **argv)
|
||||||
"recipient certificate file");
|
"recipient certificate file");
|
||||||
if (cert == NULL)
|
if (cert == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
sk_X509_push(encerts, cert);
|
if (!sk_X509_push(encerts, cert))
|
||||||
|
goto end;
|
||||||
cert = NULL;
|
cert = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue