aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-05-29 08:14:50 +0000
committerTorbjörn Andersson2010-05-29 08:14:50 +0000
commit928eafcccf755859a86587e01b676d020baf4d85 (patch)
treefaea04b4353cd9bd59da4ddb1bb43054ba838a1e /engines
parent1c32db1e084698f6594a66e142c217e83cab60d9 (diff)
downloadscummvm-rg350-928eafcccf755859a86587e01b676d020baf4d85.tar.gz
scummvm-rg350-928eafcccf755859a86587e01b676d020baf4d85.tar.bz2
scummvm-rg350-928eafcccf755859a86587e01b676d020baf4d85.zip
Fixed potential memory leak found by cppcheck. Though I'm guessing that if this
case happens, we may have bigger problems... svn-id: r49307
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/resource_he.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 886ee99e57..c259c3ffd2 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -633,8 +633,10 @@ Win32ResExtractor::WinResource *Win32ResExtractor::list_pe_resources(WinLibrary
wr[c].children = fi->first_resource + (FROM_LE_32(dirent[c].offset_to_data) & ~IMAGE_RESOURCE_DATA_IS_DIRECTORY);
/* fill in wr->id, wr->numeric_id */
- if (!decode_pe_resource_id(fi, wr + c, FROM_LE_32(dirent[c].name)))
+ if (!decode_pe_resource_id(fi, wr + c, FROM_LE_32(dirent[c].name))) {
+ free(wr);
return NULL;
+ }
}
return wr;