0
0
Fork 0
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 ()

This commit is contained in:
Emmanuel Vasilakis 2022-07-05 16:17:29 +03:00 committed by GitHub
parent e1fa952b0b
commit a26cd8d8a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}