Unverified Commit 80965154 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix invalid dictNext usage when pubsubshard_channels became empty (#13033)

After #12822, when pubsubshard_channels became empty, kvstoreDictDelete
will delete the dict (which is the only one currently deleting dicts
that
become empty) and in the next loop, we will make an invalid call to
dictNext.

After the dict becomes empty, we break out of the loop without calling
dictNext.
parent 13bd3643
......@@ -350,6 +350,9 @@ void pubsubShardUnsubscribeAllChannelsInSlot(unsigned int slot) {
}
dictReleaseIterator(iter);
kvstoreDictDelete(server.pubsubshard_channels, slot, channel);
/* After the dict becomes empty, the dict will be deleted.
* We break out without calling dictNext. */
if (!kvstoreDictSize(server.pubsubshard_channels, slot)) break;
}
dictReleaseIterator(di);
}
......
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