diff options
author | jackpoz <giacomopoz@gmail.com> | 2015-06-20 22:42:30 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2015-06-20 22:42:30 +0200 |
commit | c6c09423fd226a970b0b39cdd2586e9ae3a07f6b (patch) | |
tree | 9416e5d3eefd2f7d1d793339995e6df28e62a5eb /src | |
parent | a5b3862bc1b066a9614369bda3adef485a57eff8 (diff) |
Scripts/Commands: Fix memory leak in ".reload command"
Free commandTableCache object before assigning it the result of malloc()
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 1716aa73525..3cbdcbcaff1 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -78,6 +78,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); |