test: nand: Free allocated buffers after test
The run_test_nand() function allocates buf and gold buffers but never
frees them, leaking about 2MB per test run.
Fixes: bc8e8a4bfa ("nand: Add sandbox driver")
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user