- * We do this only if server.masterhost != NULL. If it is NULL this
- * means the user called SLAVEOF NO ONE and we are freeing our
- * link with the master, so no need to close link with slaves. */
- if (server.masterhost != NULL) {
- while (listLength(server.slaves)) {
- ln = listFirst(server.slaves);
- freeClient((redisClient*)ln->value);
- }
- }
+ * If server.masterhost is NULL the user called SLAVEOF NO ONE so
+ * slave resync is not needed. */
+ if (server.masterhost != NULL) disconnectSlaves();