summaryrefslogtreecommitdiff
path: root/src
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 /src
parentfc342cc8deacdf826e343b1ce796b47bbd918f61 (diff)
downloadmana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.gz
mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.bz2
mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.xz
mana-00a698fe8b1babdc323842ee497107d9ed278ebc.zip
Fix a memory leak.
Diffstat (limited to 'src')
-rw-r--r--src/gui/npc.cpp4
1 files changed, 1 insertions, 3 deletions
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, ":");
}