The fdt allocated with of_get_flattened_tree() is never freed, add
missing free() after usage.

Signed-off-by: Sascha Hauer <[email protected]>
---
 commands/oftree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/commands/oftree.c b/commands/oftree.c
index b172aee9e0..53ca44bb86 100644
--- a/commands/oftree.c
+++ b/commands/oftree.c
@@ -74,6 +74,8 @@ static int do_oftree(int argc, char *argv[])
 
                ret = write_file(save, fdt, fdt32_to_cpu(fdt->totalsize));
 
+               free(fdt);
+
                goto out;
        }
 
-- 
2.47.3


Reply via email to