summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2020-09-25 16:19:41 +0300
committerGitHub <noreply@github.com>2020-09-25 16:19:41 +0300
commited0546b32e2c4b19c3aead1ae8230c38b024517b (patch)
tree3dd8351a7e94ab961f2568a75b3963d973a2e0e9 /web
parent2035343d16f3106ad6f6ce5b2fcb7384bc511668 (diff)
Fixed locking order to address CID_362348 (#9991)
Diffstat (limited to 'web')
-rw-r--r--web/api/formatters/rrd2json.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/api/formatters/rrd2json.c b/web/api/formatters/rrd2json.c
index 7bb7544cfe..45ec3c2030 100644
--- a/web/api/formatters/rrd2json.c
+++ b/web/api/formatters/rrd2json.c
@@ -45,12 +45,12 @@ void build_context_param_list(struct context_param **param_list, RRDSET *st)
}
RRDDIM *rd1;
- rrdset_rdlock(st);
-
- st->last_accessed_time = now_realtime_sec();
(*param_list)->first_entry_t = MIN((*param_list)->first_entry_t, rrdset_first_entry_t(st));
(*param_list)->last_entry_t = MAX((*param_list)->last_entry_t, rrdset_last_entry_t(st));
+ st->last_accessed_time = now_realtime_sec();
+ rrdset_rdlock(st);
+
rrddim_foreach_read(rd1, st) {
RRDDIM *rd = mallocz(rd1->memsize);
memcpy(rd, rd1, rd1->memsize);