Hi,
I found memory leak in FreeRTOS + FAT, every create task, open/close file and than delete task generate 268 B leak.
In ff_fopen we use prvABSPath and pxFindCWD with ffconfigMALLOC to malloc some space (268 B) for pvThreadLocalStoragePointers.
In prvDeleteTCB there isn’t ffconfigFREE or vPortFree for pvThreadLocalStoragePointers.
but when we use stdioERRNO_THREAD_LOCAL_OFFSET=ffconfigCWD_THREAD_LOCAL_INDEX+0 or stdioFF_ERROR_THREAD_LOCAL_OFFSET=ffconfigCWD_THREAD_LOCAL_INDEX+2, there is int value not pointer in vTaskSetThreadLocalStoragePointer and it should be change too.
Very soon the +FAT code will be in a Labs directory of the main download, so under normal source control, which will make these fixes easier to control.
I think that it would not be correct to change prvDeleteTCB() for this purpose.
The kernel does not make any assumption about the thread-local-storage-pointers. Maybe it is just a copy of a pointer, and maybe it is an integer value like errno, cast to a pointer.