summaryrefslogtreecommitdiffstats
path: root/common/bootm.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-02-17 19:45:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-02-18 12:58:20 +0100
commitf1f8f5556ab94f4f8bedb97ad0199b2e63958c8b (patch)
tree87420d3aaa4568f90ff753e5b453b47c611efcb6 /common/bootm.c
parent2629cc9d46993b28292f3455093203d7d9fff18c (diff)
downloadbarebox-f1f8f5556ab94f4f8bedb97ad0199b2e63958c8b.tar.gz
bootm: Free allocated fdt buffer in error path
It seems like there is a memory leak in an error path of bootm_open_oftree_uimage() where the memory allocated for the fdt is not released again. Signed-off-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/bootm.c')
-rw-r--r--common/bootm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/bootm.c b/common/bootm.c
index 052cffa..7d00f8e 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -288,6 +288,7 @@ static int bootm_open_oftree_uimage(struct image_data *data, size_t *size,
if (ft != filetype_oftree) {
printf("%s is not an oftree but %s\n",
data->oftree_file, file_type_to_string(ft));
+ free(*fdt);
return -EINVAL;
}