mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
fdtdec: test: Fix memory leak
Free the memory allocated to store the test FDT upon test completion to avoid leaking the memory. We don't bother cleaning up on test failure since the code is broken in that case and should be fixed, in which case the leak would also go away. Reported-by: Tom Rini <tom.rini@gmail.com> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
1edc5688df
commit
848e94d0ba
1 changed files with 2 additions and 0 deletions
|
@ -138,6 +138,7 @@ static int run_test(const char *aliases, const char *nodes, const char *expect)
|
|||
}
|
||||
|
||||
printf("pass\n");
|
||||
free(blob);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -292,6 +293,7 @@ static int check_carveout(void)
|
|||
CHECKVAL(make_fdt_carveout(fdt, FDT_SIZE, 2, 2), 0);
|
||||
CHECKOK(check_fdt_carveout(fdt, 2, 2));
|
||||
|
||||
free(fdt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue