Fix file descriptor leak in LoadOldSaveGame
LoadOldSaveGame was leaking a file descriptor when it successfully loaded a savegame. (cherry picked from commit f47cfbbba0b182f116109e02445bb419fab1a157)
This commit is contained in:

committed by
Jonathan G Rennison

parent
293ce8b4ab
commit
c5e30b8f04
@@ -308,9 +308,10 @@ bool LoadOldSaveGame(const char *file)
|
||||
game_loaded = false;
|
||||
}
|
||||
|
||||
fclose(ls.file);
|
||||
|
||||
if (!game_loaded) {
|
||||
SetSaveLoadError(STR_GAME_SAVELOAD_ERROR_DATA_INTEGRITY_CHECK_FAILED);
|
||||
fclose(ls.file);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user