diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-27 20:40:03 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-27 20:40:03 +0000 |
commit | 00a698fe8b1babdc323842ee497107d9ed278ebc (patch) | |
tree | 3c1c4df1bcfc0f28f43d4cf7cce68243e18333e7 /src/gui/npc.cpp | |
parent | fc342cc8deacdf826e343b1ce796b47bbd918f61 (diff) | |
download | mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.gz mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.bz2 mana-00a698fe8b1babdc323842ee497107d9ed278ebc.tar.xz mana-00a698fe8b1babdc323842ee497107d9ed278ebc.zip |
Fix a memory leak.
Diffstat (limited to 'src/gui/npc.cpp')
-rw-r--r-- | src/gui/npc.cpp | 4 |
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, ":"); } |