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.
This commit is contained in:
antirez 2013-12-17 14:50:24 +01:00
parent fda91dbde3
commit 7a666ac419

View File

@ -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) {