mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
a2ed351365
commit
b0ea8848a5
7 changed files with 29 additions and 19 deletions
|
|
@ -768,7 +768,7 @@ void ChatHandler::SendSysMessage(const char *str)
|
|||
WorldPacket data;
|
||||
|
||||
// need copy to prevent corruption by strtok call in LineFromMessage original string
|
||||
char* buf = strdup(str);
|
||||
char* buf = mangos_strdup(str);
|
||||
char* pos = buf;
|
||||
|
||||
while(char* line = LineFromMessage(pos))
|
||||
|
|
@ -777,7 +777,7 @@ void ChatHandler::SendSysMessage(const char *str)
|
|||
m_session->SendPacket(&data);
|
||||
}
|
||||
|
||||
free(buf);
|
||||
delete [] buf;
|
||||
}
|
||||
|
||||
void ChatHandler::SendGlobalSysMessage(const char *str)
|
||||
|
|
@ -786,7 +786,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str)
|
|||
WorldPacket data;
|
||||
|
||||
// need copy to prevent corruption by strtok call in LineFromMessage original string
|
||||
char* buf = strdup(str);
|
||||
char* buf = mangos_strdup(str);
|
||||
char* pos = buf;
|
||||
|
||||
while(char* line = LineFromMessage(pos))
|
||||
|
|
@ -795,7 +795,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str)
|
|||
sWorld.SendGlobalMessage(&data);
|
||||
}
|
||||
|
||||
free(buf);
|
||||
delete [] buf;
|
||||
}
|
||||
|
||||
void ChatHandler::SendSysMessage(int32 entry)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue