mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 16:26:53 +00:00
KINGDOM: Fix memory leak. PVS-Studio V773
This commit is contained in:
parent
69271d16bf
commit
5656c999f8
@ -389,6 +389,7 @@ Common::SeekableReadStream *KingdomGame::loadAResource(int reznum) {
|
|||||||
Common::File *file = new Common::File();
|
Common::File *file = new Common::File();
|
||||||
if(!file->open(path)) {
|
if(!file->open(path)) {
|
||||||
warning("Failed to open %s", path.c_str());
|
warning("Failed to open %s", path.c_str());
|
||||||
|
delete file;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} else {
|
} else {
|
||||||
return file;
|
return file;
|
||||||
|
Loading…
Reference in New Issue
Block a user