Commit 3770f02f93 for openssl.org
commit 3770f02f933cc73a18711e972c031dc7c40d533d
Author: Eugene Syromiatnikov <esyr@openssl.org>
Date: Mon Feb 23 03:55:36 2026 +0100
apps/ech.c: free the resources on option help printing
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)
diff --git a/apps/ech.c b/apps/ech.c
index 4626ec6363..c5959b297b 100644
--- a/apps/ech.c
+++ b/apps/ech.c
@@ -275,6 +275,8 @@ end:
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;
}