[Concept,27/33] test: upl: Dispose oftrees in upl_test_base()

Message ID 20260416023021.626949-28-sjg@u-boot.org
State New
Headers
Series Fix memory leaks and test pollution in sandbox tests |

Commit Message

Simon Glass April 16, 2026, 2:29 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

This test builds two live trees via upl_create_handoff_tree() and
oftree_from_fdt() but never disposes them, leaking most of the node and
property allocations on each run.

Dispose of both before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/boot/upl.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/test/boot/upl.c b/test/boot/upl.c
index e2dc3d51eda..0730f102a78 100644
--- a/test/boot/upl.c
+++ b/test/boot/upl.c
@@ -352,6 +352,8 @@  static int upl_test_base(struct unit_test_state *uts)
 
 	ut_assertok(upl_read_handoff(&check, check_tree));
 	ut_assertok(compare_upl(uts, &upl, &check));
+	oftree_dispose(check_tree);
+	oftree_dispose(tree);
 	abuf_uninit(&buf);
 
 	return 0;