[MOSYNC-3208] Fixed the memory issue in the fileListNext function.