]> arthur.barton.de Git - netdata.git/commitdiff
prevent a crash on SIGUSR2
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 3 Sep 2016 17:36:06 +0000 (20:36 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 3 Sep 2016 17:36:06 +0000 (20:36 +0300)
src/health.c

index 80d506a5c3fdddb749807d8b4002825438873fef..edc2849ee8e7a73fbbb1b11b7f838d5f389cc62f 100644 (file)
@@ -442,6 +442,10 @@ static void rrdsetcalc_link(RRDSET *st, RRDCALC *rc) {
 
     rc->rrdset_next = st->alarms;
     rc->rrdset_prev = NULL;
+    
+    if(rc->rrdset_next)
+        rc->rrdset_next->rrdset_prev = rc;
+
     st->alarms = rc;
 
     if(rc->update_every < rc->rrdset->update_every) {
@@ -708,7 +712,6 @@ void rrdcalc_free(RRDHOST *host, RRDCALC *rc) {
 
     else if(likely(host->alarms)) {
         RRDCALC *t, *last = host->alarms;
-
         for(t = last->next; t && t != rc; last = t, t = t->next) ;
         if(last && last->next == rc)
             last->next = rc->next;