mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-10-28 03:32:12 +01: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:
committed by
Mimi Zohar
parent
c7928795cd
commit
066685d162
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user