From 066685d162050ef79b51ed3a3da455937b313e24 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 2 Nov 2022 14:45:34 -0400 Subject: [PATCH] Change condition to free(pub) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the condition under which pub is freed to make it clearer for the reader and analyzer. This change gets rid of the following gcc -fanalyzer warning: evmctl.c:1140:12: warning: leak of ‘pub’ [CWE-401] [-Wanalyzer-malloc-leak] 1140 | if (imaevm_params.x509) | ^ Signed-off-by: Stefan Berger Signed-off-by: Mimi Zohar --- src/evmctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evmctl.c b/src/evmctl.c index 2de8530..0ac7930 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -1140,7 +1140,7 @@ static int cmd_import(struct command *cmd) log_info("keyid: %d\n", id); printf("%d\n", id); } - if (imaevm_params.x509) + if (pub != _pub) free(pub); return err; }