aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/overlay.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 2f4b375865..d618ab5599 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -185,11 +185,10 @@ int loadOverlay(const char *scriptName) {
// This memory block will be later passed to a MemoryReadStream, which will dispose of it
unpackedBuffer = (byte *)malloc(unpackedSize);
- memset(unpackedBuffer, 0, unpackedSize);
-
if (!unpackedBuffer) {
return (-2);
}
+ memset(unpackedBuffer, 0, unpackedSize);
if (volumePtrToFileDescriptor[fileIdx].size + 2 != unpackedSize) {
char *pakedBuffer =
@@ -566,11 +565,10 @@ int loadOverlay(const char *scriptName) {
// This memory block will be later passed to a MemoryReadStream, which will dispose of it
unpackedBuffer = (byte *)malloc(unpackedSize);
- memset(unpackedBuffer, 0, unpackedSize);
-
if (!unpackedBuffer) {
return (-2);
}
+ memset(unpackedBuffer, 0, unpackedSize);
if (volumePtrToFileDescriptor[fileIdx].size + 2 !=
unpackedSize) {