[8736] operator new[] based version of strdup() function to get bonuses from Intel Memory allocator mainly in DB code

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2009-10-26 01:05:08 +02:00
parent a2ed351365
commit b0ea8848a5
7 changed files with 29 additions and 19 deletions

View file

@ -1769,7 +1769,7 @@ void World::SendGlobalText(const char* text, WorldSession *self)
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(text);
char* buf = mangos_strdup(text);
char* pos = buf;
while(char* line = ChatHandler::LineFromMessage(pos))
@ -1778,7 +1778,7 @@ void World::SendGlobalText(const char* text, WorldSession *self)
SendGlobalMessage(&data, self);
}
free(buf);
delete [] buf;
}
/// Send a packet to all players (or players selected team) in the zone (except self if mentioned)