aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword1/control.cpp4
-rw-r--r--engines/sword2/resman.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 2134e7dc2d..5a3c614df4 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -1268,7 +1268,7 @@ bool Control::convertSaveGame(uint8 slot, char* desc) {
if (!newSave) {
// Display a warning message and do nothing
warning("Unable to create file '%s'. (%s)", newFileName, _saveFileMan->popErrorDesc().c_str());
- free(saveData);
+ delete[] saveData;
saveData = NULL;
return false;
}
@@ -1299,7 +1299,7 @@ bool Control::convertSaveGame(uint8 slot, char* desc) {
_saveFileMan->removeSavefile(oldFileName);
// Cleanup
- free(saveData);
+ delete[] saveData;
saveData = NULL;
return true;
}
diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp
index c49fb8e786..330abf4adf 100644
--- a/engines/sword2/resman.cpp
+++ b/engines/sword2/resman.cpp
@@ -179,7 +179,7 @@ bool ResourceManager::init() {
cdInf[i].cd = file.readByte();
if (file.eos() || file.err()) {
- delete cdInf;
+ delete[] cdInf;
file.close();
GUIErrorMessage("Broken Sword 2: Cannot read cd.inf");
return false;