mirror of https://github.com/openssl/openssl
Fix a possible memleak in opt_verify
The ASN1_OBJECT otmp was leaked if X509_VERIFY_PARAM_add0_policy fails. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22922)
This commit is contained in:
parent
01709fcb8b
commit
d6688e45fa
|
@ -726,7 +726,12 @@ int opt_verify(int opt, X509_VERIFY_PARAM *vpm)
|
||||||
opt_printf_stderr("%s: Invalid Policy %s\n", prog, opt_arg());
|
opt_printf_stderr("%s: Invalid Policy %s\n", prog, opt_arg());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
X509_VERIFY_PARAM_add0_policy(vpm, otmp);
|
if (!X509_VERIFY_PARAM_add0_policy(vpm, otmp)) {
|
||||||
|
ASN1_OBJECT_free(otmp);
|
||||||
|
opt_printf_stderr("%s: Internal error adding Policy %s\n",
|
||||||
|
prog, opt_arg());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case OPT_V_PURPOSE:
|
case OPT_V_PURPOSE:
|
||||||
/* purpose name -> purpose index */
|
/* purpose name -> purpose index */
|
||||||
|
|
Loading…
Reference in New Issue