From 2e45cc13817ca5ae211daa296ba85a49497983e8 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 21 May 2026 11:25:48 -0400 Subject: [PATCH] evmctl: Fix the label to jump to in case of fopen failing In case of fopen failing, jump to out_free to skip the flose(fp) and avoid a segfault. Fixes: d7dffec5f74f ("Fix memory leaks of tpm_bank_info allocations") Signed-off-by: Stefan Berger --- src/evmctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evmctl.c b/src/evmctl.c index e638682..98ae85c 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -2358,7 +2358,7 @@ static int ima_measurement(const char *file) fp = fopen(file, "rb"); if (!fp) { log_err("Failed to open measurement file: %s\n", file); - goto out; + goto out_free; } if (imaevm_params.keyfile) /* Support multiple public keys */