Fix Coverity Defect CID-349684 (#8586)
This PR brought a test before to call the function `health_add_params` to avoid memory leak.
thiagoftsm committed
Apr 3, 2020 at 12:18 UTC
4ce1b108afecf6e335e112136165e96539e77b92
1 file changed
+2
-2
libnetdata/health/health.c
+2
-2
@@ -138,8 +138,8 @@ int health_silencers_json_read_callback(JSON_ENTRY *e)
138
else if (!strcmp(e->data.string,"DISABLE")) silencers->stype = STYPE_DISABLE_ALARMS;
139
} else {
140
debug(D_HEALTH, "JSON: Adding %s=%s", e->name, e->data.string);
141
- SILENCER *test = health_silencers_addparam(e->callback_data, e->name, e->data.string);
142
- (void)test;
141
+ if (e->callback_data)
142
+ (void)health_silencers_addparam(e->callback_data, e->name, e->data.string);
143
}
144
break;
145