aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2017-08-13 16:20:50 +0200
committerTorbjörn Andersson2017-08-13 16:20:50 +0200
commit0c6496b111a116966da974f3e7bd61fb7756dd1d (patch)
tree4a346d851568ba6566b7767d64175c59169bbdb8
parent8aeeacf204db92e14df1e7b12f66f8c292e6e3e0 (diff)
downloadscummvm-rg350-0c6496b111a116966da974f3e7bd61fb7756dd1d.tar.gz
scummvm-rg350-0c6496b111a116966da974f3e7bd61fb7756dd1d.tar.bz2
scummvm-rg350-0c6496b111a116966da974f3e7bd61fb7756dd1d.zip
BLADERUNNER: Fix potential memory leak (CppCheck warning)
-rw-r--r--engines/bladerunner/vqa_decoder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp
index c43e4c3f9d..377251714b 100644
--- a/engines/bladerunner/vqa_decoder.cpp
+++ b/engines/bladerunner/vqa_decoder.cpp
@@ -493,8 +493,10 @@ bool VQADecoder::readLNIN(Common::SeekableReadStream *s, uint32 size) {
}
readIFFChunkHeader(_s, &chd);
- if (chd.id != kLNID)
+ if (chd.id != kLNID) {
+ free(loopNameOffsets);
return false;
+ }
char *names = (char*)malloc(roundup(chd.size));
s->read(names, roundup(chd.size));