Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/37419 )
Change subject: Fix CID 264285 Resource leak ......................................................................
Fix CID 264285 Resource leak
get_em100_file() allocates memory for the file name, so we have to free it again.
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Change-Id: I59b7eafc828fd1a2e48e4b8a84708bfeff05c8f1 Reviewed-on: https://review.coreboot.org/c/em100/+/37419 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M em100.c 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/em100.c b/em100.c index ad341e8..d17b707 100644 --- a/em100.c +++ b/em100.c @@ -666,7 +666,9 @@ static chipdesc *setup_chips(const char *desiredchip) { static chipdesc chip; - configs = tar_load_compressed(get_em100_file("configs.tar.xz")); + char *configs_name = get_em100_file("configs.tar.xz"); + configs = tar_load_compressed(configs_name); + free(configs_name); if (!configs) { printf("Can't find chip configs in $EM100_HOME/configs.tar.xz.\n"); return NULL;