summaryrefslogtreecommitdiffstats
path: root/database/rrdhost.c
diff options
context:
space:
mode:
authorhexchain <hexchain@users.noreply.github.com>2020-11-15 18:27:54 +0100
committerGitHub <noreply@github.com>2020-11-15 17:27:54 +0000
commit991d5b0257c1f1c74df3bfb979fc609034c20987 (patch)
treedcc593bb7912ead264e0ff6518fdf69ae781ae2f /database/rrdhost.c
parented3132182eb28b36882bb0bcb82e32632fde42be (diff)
database: fix endless loop when cleaning obsolete charts (#10236)
Thank you very much @hexchain !
Diffstat (limited to 'database/rrdhost.c')
-rw-r--r--database/rrdhost.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/database/rrdhost.c b/database/rrdhost.c
index 421acbb65d..6010aaf1fd 100644
--- a/database/rrdhost.c
+++ b/database/rrdhost.c
@@ -1528,8 +1528,11 @@ restart_after_removal:
while (st->alarms) rrdsetcalc_unlink(st->alarms);
rrdset_wrlock(st);
for (rd = st->dimensions, last = NULL ; likely(rd) ; ) {
- if (rrddim_flag_check(rd, RRDDIM_FLAG_ARCHIVED))
+ if (rrddim_flag_check(rd, RRDDIM_FLAG_ARCHIVED)) {
+ last = rd;
+ rd = rd->next;
continue;
+ }
rrddim_flag_set(rd, RRDDIM_FLAG_ARCHIVED);
while (rd->variables)