mirror of https://github.com/openssl/openssl
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");
|
"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