Fixed locking order to address CID_362348 (#9991)
Stelios Fragkakis committed
Sep 25, 2020 at 16:19 UTC
ed0546b32e2c4b19c3aead1ae8230c38b024517b
1 file changed
+3
-3
web/api/formatters/rrd2json.c
+3
-3
@@ -45,12 +45,12 @@ void build_context_param_list(struct context_param **param_list, RRDSET *st)
45
}
46
47
RRDDIM *rd1;
48
- rrdset_rdlock(st);
49
-
50
- st->last_accessed_time = now_realtime_sec();
48
(*param_list)->first_entry_t = MIN((*param_list)->first_entry_t, rrdset_first_entry_t(st));
49
(*param_list)->last_entry_t = MAX((*param_list)->last_entry_t, rrdset_last_entry_t(st));
50
51
+ st->last_accessed_time = now_realtime_sec();
52
+ rrdset_rdlock(st);
53
+
54
rrddim_foreach_read(rd1, st) {
55
RRDDIM *rd = mallocz(rd1->memsize);
56
memcpy(rd, rd1, rd1->memsize);