Scripts/Commands: Fix memory leak in ".reload command"
Free commandTableCache object before assigning it the result of malloc()
This commit is contained in:
1 parent
a5b3862bc1
commit
c6c09423fd
1 file changed
+1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user