From a6370aa68847bf110e6fd3d8a41114ec79c8456a Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 22 Jul 2016 12:20:54 -0500 Subject: SCI: Fix memory leaks in ResourceManager --- engines/sci/resource.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/sci/resource.cpp') 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; } -- cgit v1.2.3