CRUISE: Plug memory leak

This commit is contained in:
Eugene Sandulenko 2016-05-07 10:29:49 +02:00
parent afdbfe4d2f
commit 9fd172cba6

View File

@ -249,9 +249,13 @@ int loadFile(const char* name, int idx, int destIdx) {
int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);
if (destIdx > numMaxEntriesInSet) {
MemFree(ptr);
return 0; // exit if limit is reached
}
return loadSetEntry(name, ptr, destIdx, idx);
int res = loadSetEntry(name, ptr, destIdx, idx);
MemFree(ptr);
return res;
}
case type_FNT: {
return loadFNTSub(ptr, idx);