mirror of https://mirror.osredm.com/root/redis.git
Fix memleak issues in redis-cli (#14186)
This commit is contained in:
parent
b8382f0540
commit
ebf19e4c92
|
@ -453,7 +453,11 @@ static void cliLegacyIntegrateHelp(void) {
|
|||
if (cliConnect(CC_QUIET) == REDIS_ERR) return;
|
||||
|
||||
redisReply *reply = redisCommand(context, "COMMAND");
|
||||
if(reply == NULL || reply->type != REDIS_REPLY_ARRAY) return;
|
||||
if (reply == NULL) return;
|
||||
if (reply->type != REDIS_REPLY_ARRAY) {
|
||||
freeReplyObject(reply);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Scan the array reported by COMMAND and fill only the entries that
|
||||
* don't already match what we have. */
|
||||
|
@ -943,7 +947,10 @@ static void cliInitHelp(void) {
|
|||
cliLegacyIntegrateHelp();
|
||||
return;
|
||||
};
|
||||
if (commandTable->type != REDIS_REPLY_MAP && commandTable->type != REDIS_REPLY_ARRAY) return;
|
||||
if (commandTable->type != REDIS_REPLY_MAP && commandTable->type != REDIS_REPLY_ARRAY) {
|
||||
freeReplyObject(commandTable);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Scan the array reported by COMMAND DOCS and fill in the entries */
|
||||
helpEntriesLen = cliCountCommands(commandTable);
|
||||
|
|
Loading…
Reference in New Issue