aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/draci/detection.cpp')
-rw-r--r--engines/draci/detection.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 1d58d25cfa..f9fb7ffa54 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -143,9 +143,13 @@ SaveStateList DraciMetaEngine::listSaves(const char *target) const {
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
if (in) {
Draci::DraciSavegameHeader header;
- Draci::readSavegameHeader(in, header);
- saveList.push_back(SaveStateDescriptor(slotNum, header.saveName));
- if (header.thumbnail) delete header.thumbnail;
+ if (Draci::readSavegameHeader(in, header)) {
+ saveList.push_back(SaveStateDescriptor(slotNum, header.saveName));
+ if (header.thumbnail) {
+ header.thumbnail->free();
+ delete header.thumbnail;
+ }
+ }
delete in;
}
}