ASYLUM: fix memory leak

This commit is contained in:
alxpnv 2021-09-22 15:50:06 +03:00
parent 4901928d5c
commit c368834a9e

View File

@ -82,10 +82,14 @@ SaveStateDescriptor AsylumMetaEngine::querySaveMetaInfos(const char *target, int
if (desc.getSaveSlot() == -1) {
Common::InSaveFile *in(g_system->getSavefileManager()->openForLoading(getSavegameFile(slot, target)));
if (in && in->size()) {
(void)(uint32)Asylum::Savegame::read(in, "Chapter");
desc.setSaveSlot(slot);
desc.setDescription(Asylum::Savegame::read(in, 45, "Game Name"));
if (in) {
if (in->size() > 60) {
(void)(uint32)Asylum::Savegame::read(in, "Chapter");
desc.setSaveSlot(slot);
desc.setDescription(Asylum::Savegame::read(in, 45, "Game Name"));
}
delete in;
}
}