Avoid leaking resources when jumping to opthelp by executing the same
freeing routines.
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=
1681452
Fixes: 4af71a77387c "ECH CLI implementation"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Feb 25 11:10:37 2026
(Merged from https://github.com/openssl/openssl/pull/30139)
opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
BIO_printf(bio_err, "\tup to %d -in instances allowed\n", OSSL_ECH_MAXINFILES);
+ OSSL_ECHSTORE_free(es);
+ BIO_free_all(ecf);
return rv;
}