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;
