Unverified Commit 3a08819f authored by LuMingYinDetect's avatar LuMingYinDetect Committed by GitHub
Browse files

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



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

---------
Co-authored-by: default avatardebing.sun <debing.sun@redis.com>
parent 6f0ddc9d
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment