Fix some memory leaks in redis-cli (#13258)

Fix memory leak related to variable slot_nodes  in the
clusterManagerFixSlotsCoverage() function.

---------

Co-authored-by: debing.sun <debing.sun@redis.com>
This commit is contained in:
LuMingYinDetect 2024-08-08 10:51:33 +08:00 committed by GitHub
parent 6f0ddc9d92
commit 3a08819f51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -3694,6 +3694,8 @@ static int evalMode(int argc, char **argv) {
/* Call it */
int eval_ldb = config.eval_ldb; /* Save it, may be reverted. */
retval = issueCommand(argc+3-got_comma, argv2);
for (j = 0; j < argc+3-got_comma; j++) sdsfree(argv2[j]);
free(argv2);
if (eval_ldb) {
if (!config.eval_ldb) {
/* If the debugging session ended immediately, there was an
@ -6079,6 +6081,7 @@ static int clusterManagerFixSlotsCoverage(char *all_slots) {
if (!clusterManagerCheckRedisReply(n, reply, NULL)) {
fixed = -1;
if (reply) freeReplyObject(reply);
if (slot_nodes) listRelease(slot_nodes);
goto cleanup;
}
assert(reply->type == REDIS_REPLY_ARRAY);