summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-27 20:40:03 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-27 20:40:03 +0000
commit00a698fe8b1babdc323842ee497107d9ed278ebc (patch)
tree3c1c4df1bcfc0f28f43d4cf7cce68243e18333e7
parentfc342cc8deacdf826e343b1ce796b47bbd918f61 (diff)
downloadmana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.gz
mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.bz2
mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.xz
mana-00a698fe8b1babdc323842ee497107d9ed278ebc.zip
Fix a memory leak.
-rw-r--r--ChangeLog1
-rw-r--r--src/gui/npc.cpp4
2 files changed, 2 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index af87bfa6..c5e261ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
2005-08-27 Björn Steinbrink <B.Steinbrink@gmx.de>
+ * src/gui/npc.cpp: Fix a memory leak.
* src/game.cpp, src/gui/npc.cpp, src/gui/npc.h: Fix the bug when
sometimes the last entry in npc list windows is missing. The network
buffer isn't reset to all zeros, thus we can't rely on the received
diff --git a/src/gui/npc.cpp b/src/gui/npc.cpp
index 99d3b3a5..0756d809 100644
--- a/src/gui/npc.cpp
+++ b/src/gui/npc.cpp
@@ -87,9 +87,7 @@ void NpcListDialog::parseItems(const char *string, unsigned short len) {
char *token = strtok(copy, ":");
while (token) {
- char *temp = (char*)malloc(strlen(token) + 1);
- strcpy(temp, token);
- items.push_back(std::string(temp));
+ items.push_back(token);
token = strtok(NULL, ":");
}