fix disconnectSlaves, to try to free each slave.

the recent change in that loop (iteration rather than waiting for it to
be empty) was intended to avoid an endless loop in case some slave would
refuse to be freed.

but the lookup of the first client remained, which would have caused it
to try the first one again and again instead of moving on.
This commit is contained in:
Oran Agra 2020-06-08 09:50:06 +03:00 committed by antirez
parent 2a8ee55176
commit 216b5a1aae

View File

@ -1019,7 +1019,6 @@ void disconnectSlaves(void) {
listNode *ln; listNode *ln;
listRewind(server.slaves,&li); listRewind(server.slaves,&li);
while((ln = listNext(&li))) { while((ln = listNext(&li))) {
listNode *ln = listFirst(server.slaves);
freeClient((client*)ln->value); freeClient((client*)ln->value);
} }
} }