fix(fatfs): fix a memory leak bug when FF_USE_DYN_BUFFER was enabled

BDL diskio test part only; the rest of the commit is already on release/v6.0
via 4f7b1af0f9, which predates components/fatfs/test_apps/bdl.

(cherry picked from commit a8b5b8d582)
This commit is contained in:
LiPeng
2026-09-10 08:36:12 +02:00
committed by Martin Vychodil
parent 0a3ee6d019
commit 841c3a4de7

View File

@@ -80,9 +80,15 @@ TEST_CASE("(BDL) diskio register, format, write and read on partition", "[fatfs]
TEST_ASSERT_EQUAL(FR_OK, f_mkfs(drv, &opt, work_area, sizeof(work_area)));
FATFS fs;
#if FF_USE_DYN_BUFFER
fs.win = NULL;
#endif
TEST_ASSERT_EQUAL(FR_OK, f_mount(&fs, drv, 1));
FIL file;
#if !FF_FS_TINY && FF_USE_DYN_BUFFER
file.buf = NULL;
#endif
UINT bw;
TEST_ASSERT_EQUAL(FR_OK, f_open(&file, "test.txt", FA_OPEN_ALWAYS | FA_READ | FA_WRITE));