mirror of
https://github.com/redis/redis.git
synced 2026-10-28 08:25:04 +08:00
Fix double free of reply in redis-cli --cluster add-node (#16053)
Fixes #16051 After the function sync step, `clusterManagerCommandAddNode()` frees `reply` but doesn't clear the pointer. If resolving the first node's address for `CLUSTER MEET` then fails, the `goto cleanup` frees the same reply again. The pointer is now set to NULL after the free, so cleanup skips it.
This commit is contained in:
1 parent
81d653f5dc
commit
c039dd784c
1 file changed
+4
-1
+4
-1
@@ -7762,7 +7762,10 @@ static int clusterManagerCommandAddNode(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (reply) freeReplyObject(reply);
|
||||
if (reply) {
|
||||
freeReplyObject(reply);
|
||||
reply = NULL;
|
||||
}
|
||||
|
||||
// Send CLUSTER MEET command to the new node
|
||||
clusterManagerLogInfo(">>> Send CLUSTER MEET to node %s:%d to make it "
|
||||
|
||||
Reference in new issue
Block a user