diff options
author | Nipun Garg | 2019-07-18 18:40:05 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:23 +0200 |
commit | 8d9004e43268109394059ff267cce9983c4f5346 (patch) | |
tree | 4a8cdd459be080f966283cad4205b05e3a60402d /engines/hdb/hdb.cpp | |
parent | ea77240d4e85873fd5f006b10981509156ddba73 (diff) | |
download | scummvm-rg350-8d9004e43268109394059ff267cce9983c4f5346.tar.gz scummvm-rg350-8d9004e43268109394059ff267cce9983c4f5346.tar.bz2 scummvm-rg350-8d9004e43268109394059ff267cce9983c4f5346.zip |
HDB: Fix memory leaks when stream is returned NULL
Diffstat (limited to 'engines/hdb/hdb.cpp')
-rw-r--r-- | engines/hdb/hdb.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index 25b860495d..3419ac6cee 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -830,6 +830,7 @@ Common::Error HDBGame::run() { Common::SeekableReadStream *titleStream = _fileMan->findFirstData("monkeylogoscreen", TYPE_PIC); if (titleStream == NULL) { debug("The TitleScreen MPC entry can't be found."); + delete titleStream; return Common::kReadingFailed; } @@ -840,6 +841,7 @@ Common::Error HDBGame::run() { Common::SeekableReadStream *tileStream = _fileMan->findFirstData("t32_ground1", TYPE_TILE32); if (tileStream == NULL) { debug("The t32_shipwindow_lr MPC entry can't be found."); + delete tileStream; return Common::kReadingFailed; } |