Commit 509a6cc1 authored by antirez's avatar antirez
Browse files

Fix iterator for issue #2438.

Itereator misuse due to analyzeLatencyForEvent() accessing the
dictionary during the iteration, without the iterator being
reclared as safe.
parent c77081a4
...@@ -248,7 +248,7 @@ sds createLatencyReport(void) { ...@@ -248,7 +248,7 @@ sds createLatencyReport(void) {
dictEntry *de; dictEntry *de;
int eventnum = 0; int eventnum = 0;
di = dictGetIterator(server.latency_events); di = dictGetSafeIterator(server.latency_events);
while((de = dictNext(di)) != NULL) { while((de = dictNext(di)) != NULL) {
char *event = dictGetKey(de); char *event = dictGetKey(de);
struct latencyTimeSeries *ts = dictGetVal(de); struct latencyTimeSeries *ts = dictGetVal(de);
......
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