aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2016-07-22 12:20:54 -0500
committerColin Snover2016-07-24 11:36:48 -0500
commita6370aa68847bf110e6fd3d8a41114ec79c8456a (patch)
treec101e5a13e9f656105ff021514fb20a7a0bd44f0 /engines/sci
parent65ca749f0ac3fef8e056f9df7cb7520c38669c16 (diff)
downloadscummvm-rg350-a6370aa68847bf110e6fd3d8a41114ec79c8456a.tar.gz
scummvm-rg350-a6370aa68847bf110e6fd3d8a41114ec79c8456a.tar.bz2
scummvm-rg350-a6370aa68847bf110e6fd3d8a41114ec79c8456a.zip
SCI: Fix memory leaks in ResourceManager
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/resource.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 3e50fc1082..48278e35a7 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1367,6 +1367,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource
if (!file->open(source->getLocationName())) {
warning("ResourceManager::processPatch(): failed to open %s", source->getLocationName().c_str());
delete source;
+ delete file;
return;
}
fileStream = file;
@@ -1376,6 +1377,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource
if (fsize < 3) {
debug("Patching %s failed - file too small", source->getLocationName().c_str());
delete source;
+ delete fileStream;
return;
}