mirror of
https://github.com/netdata/netdata.git
synced 2025-04-17 11:12:42 +00:00
Remove warning from Coverity (#6992)
* health_nan: fix result The expression evaluate was keeping the value zero when there was a wrong variable, but according our documentation the correct result would be NAN, this commit fixes this * coverity_348642: remove unecessary check This commit removes an unecessary check for variable in the alarms * coverity_348642: remove fix I am removing a change from other commit here
This commit is contained in:
parent
727c208b5c
commit
a0de935378
1 changed files with 11 additions and 13 deletions
|
@ -584,21 +584,19 @@ void rrdcalc_unlink_and_free(RRDHOST *host, RRDCALC *rc) {
|
|||
error("Cannot unlink alarm '%s.%s' from host '%s': not found", rc->chart?rc->chart:"NOCHART", rc->name, host->hostname);
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
RRDCALC *rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_health_log, (avl *)rc);
|
||||
if (rdcmp) {
|
||||
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_health_log, (avl *)rc);
|
||||
if (!rdcmp) {
|
||||
error("Cannot remove the health alarm index from health_log");
|
||||
}
|
||||
RRDCALC *rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_health_log, (avl *)rc);
|
||||
if (rdcmp) {
|
||||
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_health_log, (avl *)rc);
|
||||
if (!rdcmp) {
|
||||
error("Cannot remove the health alarm index from health_log");
|
||||
}
|
||||
}
|
||||
|
||||
rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_name, (avl *)rc);
|
||||
if (rdcmp) {
|
||||
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_name, (avl *)rc);
|
||||
if (!rdcmp) {
|
||||
error("Cannot remove the health alarm index from idx_name");
|
||||
}
|
||||
rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_name, (avl *)rc);
|
||||
if (rdcmp) {
|
||||
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_name, (avl *)rc);
|
||||
if (!rdcmp) {
|
||||
error("Cannot remove the health alarm index from idx_name");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue