mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
PRIVATE: Fix memory leaks in locations and inventory
Coverity CID 1453259 Coverity CID 1453260
This commit is contained in:
parent
4fcb00a835
commit
fa6454ef4f
@ -1488,7 +1488,8 @@ void PrivateEngine::loadLocations(const Common::Rect &rect) {
|
||||
Common::String s =
|
||||
Common::String::format("%sdryloc%d.bmp", _diaryLocPrefix.c_str(), i);
|
||||
|
||||
loadMask(s, rect.left + 120, rect.top + offset, true);
|
||||
Graphics::Surface *surface = loadMask(s, rect.left + 120, rect.top + offset, true);
|
||||
delete surface;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1497,7 +1498,8 @@ void PrivateEngine::loadInventory(uint32 x, const Common::Rect &r1, const Common
|
||||
int16 offset = 0;
|
||||
for (NameList::const_iterator it = inventory.begin(); it != inventory.end(); ++it) {
|
||||
offset = offset + 22;
|
||||
loadMask(*it, r1.left, r1.top + offset, true);
|
||||
Graphics::Surface *surface = loadMask(*it, r1.left, r1.top + offset, true);
|
||||
delete surface;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user