mirror of
https://github.com/netdata/netdata.git
synced 2025-04-17 11:12:42 +00:00
Keep rc before freeing it during labels unlink alarms (#13305)
This commit is contained in:
parent
e1fa952b0b
commit
a26cd8d8a8
1 changed files with 8 additions and 2 deletions
|
@ -657,8 +657,13 @@ void rrdcalc_foreach_unlink_and_free(RRDHOST *host, RRDCALC *rc) {
|
|||
}
|
||||
|
||||
static void rrdcalc_labels_unlink_alarm_loop(RRDHOST *host, RRDCALC *alarms) {
|
||||
for(RRDCALC *rc = alarms ; rc ; rc = rc->next ) {
|
||||
if (!rc->host_labels) continue;
|
||||
for(RRDCALC *rc = alarms ; rc ; ) {
|
||||
RRDCALC *rc_next = rc->next;
|
||||
|
||||
if (!rc->host_labels) {
|
||||
rc = rc_next;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!rrdlabels_match_simple_pattern_parsed(host->host_labels, rc->host_labels_pattern, '=')) {
|
||||
info("Health configuration for alarm '%s' cannot be applied, because the host %s does not have the label(s) '%s'",
|
||||
|
@ -671,6 +676,7 @@ static void rrdcalc_labels_unlink_alarm_loop(RRDHOST *host, RRDCALC *alarms) {
|
|||
else
|
||||
rrdcalc_foreach_unlink_and_free(host, rc);
|
||||
}
|
||||
rc = rc_next;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue