Commit 7a666ac4 authored by antirez's avatar antirez
Browse files

Cluster: set n->slaves to NULL in clusterNodeResetSlaves().

The value was otherwise undefined, so next time the node was promoted
again from slave to master, adding a slave to the list of slaves
would likely crash the server or result into undefined behavior.
parent fda91dbd
......@@ -537,6 +537,7 @@ int clusterNodeAddSlave(clusterNode *master, clusterNode *slave) {
void clusterNodeResetSlaves(clusterNode *n) {
zfree(n->slaves);
n->numslaves = 0;
n->slaves = NULL;
}
void freeClusterNode(clusterNode *n) {
......
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