aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/package/packagemanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword25/package/packagemanager.h')
-rw-r--r--engines/sword25/package/packagemanager.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h
index 3c4c4e89c5..b0c6718008 100644
--- a/engines/sword25/package/packagemanager.h
+++ b/engines/sword25/package/packagemanager.h
@@ -141,6 +141,9 @@ public:
uint fileSize;
char *data = (char *)getFile(fileName, &fileSize);
char *result = (char *)malloc(fileSize + strlen(versionStr) + 1);
+ if (!result)
+ error("[PackageManager::getXmlFile] Cannot allocate memory");
+
strcpy(result, versionStr);
Common::copy(data, data + fileSize, result + strlen(versionStr));
result[fileSize + strlen(versionStr)] = '\0';
@@ -151,7 +154,7 @@ public:
return result;
}
-
+
/**
* Returns the path to the current directory.
* @return Returns a string containing the path to the current directory.