I working with FreeRTOS + FAT and i’ve got an intersting heap leakage on the function ff_chdir().
In fact when i’m using this function a MALLOC of the structure size (WorkingDirectory_t = 312 Bytes ) is used to reserve place for the current working directory. Until here every thing is alright, i can even call the function several times and the current working directory will be recognized. The problem happen when i kill the task that was using storage functions and recreate it, i can see that the heap wasn’t freed and it MALLOC again 312 bytes for the same structure.
I also figured out that the pointer to the structure was set to zero after having killed the task but the heap wasn’t freed.
I hope i was clear on the problem.
I’m maybe missing something like a function to free all memories allocated by FAT while i am killing the task ?