[PATCH 02/11] bootm: fix memory leak

Sascha Hauer s.hauer at pengutronix.de
Tue Sep 24 03:08:38 EDT 2013


data->of_root_node may be allocated from of of_unflatten_dtb.
Free it in this case.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/bootm.c b/common/bootm.c
index 1ddc6d2..14b4cff 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -299,6 +299,8 @@ err_out:
 		uimage_close(data->initrd);
 	if (data->os)
 		uimage_close(data->os);
+	if (data->of_root_node && data->of_root_node != of_get_root_node())
+		of_delete_node(data->of_root_node);
 
 	return ret;
 }
-- 
1.8.4.rc3




More information about the barebox mailing list