mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
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:
parent
fda91dbde3
commit
7a666ac419
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user