diff options
| author | jackpoz <giacomopoz@gmail.com> | 2015-06-20 22:42:30 +0200 |
|---|---|---|
| committer | DDuarte <dnpd.dd@gmail.com> | 2015-06-26 03:29:47 +0100 |
| commit | a3faa57f3b623cfb7eafa56745d93d66061e2f35 (patch) | |
| tree | b2f58d435b54202120f5d6c45a1e3104af84f258 /src | |
| parent | a5d5f98c3809175e7812dce34d987cf84e017579 (diff) | |
Scripts/Commands: Fix memory leak in ".reload command"
Free commandTableCache object before assigning it the result of malloc()
(cherry picked from commit c6c09423fd226a970b0b39cdd2586e9ae3a07f6b)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Chat/Chat.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 52c52726b73..0c4c621bff2 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -81,6 +81,7 @@ ChatCommand* ChatHandler::getCommandTable() // cache top-level commands size_t added = 0; + free(commandTableCache); commandTableCache = (ChatCommand*)malloc(sizeof(ChatCommand) * total); ASSERT(commandTableCache); memset(commandTableCache, 0, sizeof(ChatCommand) * total); |
