[Concept,v2,07/29] test: nand: Free allocated buffers after test

Message ID 20260103200510.3605009-8-sjg@u-boot.org
State New
Headers
Series Malloc debugging and test/py improvements |

Commit Message

Simon Glass Jan. 3, 2026, 8:04 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The run_test_nand() function allocates buf and gold buffers but never
frees them, leaking about 2MB per test run.

Fixes: bc8e8a4bfa0f ("nand: Add sandbox driver")
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

(no changes since v1)

 test/dm/nand.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/test/dm/nand.c b/test/dm/nand.c
index c7e09850503..ec58815ecdb 100644
--- a/test/dm/nand.c
+++ b/test/dm/nand.c
@@ -85,6 +85,9 @@  static int run_test_nand(struct unit_test_state *uts, int dev, bool end)
 	ut_asserteq(size, length);
 	ut_asserteq_mem(gold, buf, size);
 
+	free(buf);
+	free(gold);
+
 	return 0;
 }