SCI: Fix memory leaks in ResourceManager
This commit is contained in:
parent
65ca749f0a
commit
a6370aa688
1 changed files with 2 additions and 0 deletions
|
@ -1367,6 +1367,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource
|
||||||
if (!file->open(source->getLocationName())) {
|
if (!file->open(source->getLocationName())) {
|
||||||
warning("ResourceManager::processPatch(): failed to open %s", source->getLocationName().c_str());
|
warning("ResourceManager::processPatch(): failed to open %s", source->getLocationName().c_str());
|
||||||
delete source;
|
delete source;
|
||||||
|
delete file;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileStream = file;
|
fileStream = file;
|
||||||
|
@ -1376,6 +1377,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource
|
||||||
if (fsize < 3) {
|
if (fsize < 3) {
|
||||||
debug("Patching %s failed - file too small", source->getLocationName().c_str());
|
debug("Patching %s failed - file too small", source->getLocationName().c_str());
|
||||||
delete source;
|
delete source;
|
||||||
|
delete fileStream;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue