+ ERROR ("sensors plugin: malloc failed.");
+ continue;
+ }
+ memset (fl, '\0', sizeof (featurelist_t));
+
+ fl->chip = chip;
+ fl->data = feature;
+ fl->type = feature_type;
+
+ if (first_feature == NULL)
+ first_feature = fl;
+ else
+ last_feature->next = fl;
+ last_feature = fl;
+ } /* while sensors_get_all_features */
+ } /* while sensors_get_detected_chips */
+/* #endif SENSORS_API_VERSION < 0x400 */
+
+#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
+ chip_num = 0;
+ while ((chip = sensors_get_detected_chips (NULL, &chip_num)) != NULL)
+ {
+ const sensors_feature *feature;
+ int feature_num = 0;
+
+ while ((feature = sensors_get_features (chip, &feature_num)) != NULL)
+ {
+ const sensors_subfeature *subfeature;
+ int subfeature_num = 0;
+
+ /* Only handle voltage, fanspeeds and temperatures */
+ if ((feature->type != SENSORS_FEATURE_IN)
+ && (feature->type != SENSORS_FEATURE_FAN)
+ && (feature->type != SENSORS_FEATURE_TEMP))
+ {
+ DEBUG ("sensors plugin: sensors_load_conf: "
+ "Ignoring feature `%s', "
+ "because its type is not "
+ "supported.", feature->name);
+ continue;
+ }
+
+ while ((subfeature = sensors_get_all_subfeatures (chip,
+ feature, &subfeature_num)) != NULL)
+ {
+ featurelist_t *fl;
+
+ if ((subfeature->type != SENSORS_SUBFEATURE_IN_INPUT)
+ && (subfeature->type != SENSORS_SUBFEATURE_FAN_INPUT)
+ && (subfeature->type != SENSORS_SUBFEATURE_TEMP_INPUT))
+ continue;
+
+ fl = (featurelist_t *) malloc (sizeof (featurelist_t));
+ if (fl == NULL)