1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-04-27 06:12:32 +02:00

Change condition to free(pub)

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 <stefanb@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Stefan Berger 2022-11-02 14:45:34 -04:00 committed by Mimi Zohar
parent c7928795cd
commit 066685d162

View File

@ -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;
}