Merge branch 'collectd-4.3' into collectd-4.4
[collectd.git] / src / utils_threshold.c
index 6c131ba..ddce422 100644 (file)
@@ -299,7 +299,7 @@ static int ut_config_type (const threshold_t *th_orig, oconfig_item_t *ci)
 
     if (strcasecmp ("Instance", option->key) == 0)
       status = ut_config_type_instance (&th, option);
-    if (strcasecmp ("DataSource", option->key) == 0)
+    else if (strcasecmp ("DataSource", option->key) == 0)
       status = ut_config_type_datasource (&th, option);
     else if ((strcasecmp ("WarningMax", option->key) == 0)
        || (strcasecmp ("FailureMax", option->key) == 0))
@@ -645,7 +645,7 @@ static int ut_report_state (const data_set_t *ds,
            "%f. That is within the %s region of %f and %f.",
            ds->ds[ds_index].name, values[ds_index],
            (state == STATE_ERROR) ? "failure" : "warning",
-           min, min);
+           min, max);
       }
       else
       {
@@ -859,6 +859,7 @@ int ut_check_interesting (const char *name)
   if (status != 0)
   {
     ERROR ("ut_check_interesting: parse_identifier failed.");
+    sfree (name_copy);
     return (-1);
   }