prevent a crash on SIGUSR2
Costa Tsaousis (ktsaou) committed
Sep 3, 2016 at 20:36 UTC
542d3930701386bf975950db227e99826dc274ae
1 file changed
+4
-1
src/health.c
+4
-1
@@ -442,6 +442,10 @@ static void rrdsetcalc_link(RRDSET *st, RRDCALC *rc) {
442
443
rc->rrdset_next = st->alarms;
444
rc->rrdset_prev = NULL;
445
+
446
+ if(rc->rrdset_next)
447
+ rc->rrdset_next->rrdset_prev = rc;
448
+
449
st->alarms = rc;
450
451
if(rc->update_every < rc->rrdset->update_every) {
@@ -708,7 +712,6 @@ void rrdcalc_free(RRDHOST *host, RRDCALC *rc) {
712
713
else if(likely(host->alarms)) {
714
RRDCALC *t, *last = host->alarms;
711
-
715
for(t = last->next; t && t != rc; last = t, t = t->next) ;
716
if(last && last->next == rc)
717
last->next = rc->next;