The memory leak occurs at lua_pushstring(): a returned malloc'd char* string of PHYSFS_getDependentPath() is passed to lua_pushstring().
lua_pushstring() creates a copy of the passed char* string internally, so that responsibility for freeing the malloc'd char* string belongs to T-Engine.
This is simply done by patching a diff below (diff of rev. 2494 vs. local).
Code: Select all
2182c2182,2184
< lua_pushstring(L, PHYSFS_getDependentPath(src));
---
> char *alloc_path = PHYSFS_getDependentPath(src);
> lua_pushstring(L, alloc_path);
> free(alloc_path);