summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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, ":");
}