[PATCH] bootm: Free allocated fdt buffer in error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
---
 common/bootm.c | 1 +
 1 file changed, 1 insertion(+)

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;
 	}
 
-- 
2.7.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux