To make it more clear. I restate the bug as follows. There is a use-after-free bug in the FreeRTOS-Plus-FAT libary distributed at https://www.freertos.org/FreeRTOS-Labs/downloads/FreeRTOS-Plus-FAT-160919a-MIT.zip. The FATFS library is a compatible embedded FAT file system for use with or without RTOS. The bug exists in the function FF_Close() in ff_file.c. In the line 2970, the file handler pxFile is freed by the function ffconfigFREE(), which by default is a macro of vPortFree(). Later it is reused...
Use after free bug of FreeRTOS+FATFS