From 357cfb8aeab8f3c6c0c5750c69c5ebae251291ae Mon Sep 17 00:00:00 2001 From: Joost Peters Date: Sun, 9 Nov 2003 21:55:19 +0000 Subject: fix small leak svn-id: r11231 --- queen/logic.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/queen/logic.cpp b/queen/logic.cpp index fd21ee9024..33d8020835 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -2348,6 +2348,7 @@ bool Logic::gameSave(uint16 slot, const char *desc) { byte *saveData = new byte[SAVEGAME_SIZE]; byte *ptr = saveData; memcpy(ptr, buf, 32); ptr += 32; + delete[] buf; WRITE_BE_UINT16(ptr, _settings.talkSpeed); ptr += 2; WRITE_BE_UINT16(ptr, _settings.musicVolume); ptr += 2; @@ -2378,7 +2379,7 @@ bool Logic::gameSave(uint16 slot, const char *desc) { for (j = 1; j <= _areaMax[i]; j++) _area[i][j].writeTo(ptr); - for (i = 0; i <= 85; i++) + for (i = 0; i < TALK_SELECTED_COUNT; i++) _talkSelected[i].writeTo(ptr); for (i = 1; i <= _numWalkOffs; i++) @@ -2446,7 +2447,7 @@ bool Logic::gameLoad(uint16 slot) { for (j = 1; j <= _areaMax[i]; j++) _area[i][j].readFrom(ptr); - for (i = 0; i <= 85; i++) + for (i = 0; i < TALK_SELECTED_COUNT; i++) _talkSelected[i].readFrom(ptr); for (i = 1; i <= _numWalkOffs; i++) -- cgit v1.2.3