modbus plugin: malloc + memset -> calloc
[collectd.git] / src / sensors.c
index dc6a210..3b453b1 100644 (file)
@@ -176,7 +176,7 @@ static char *conffile = NULL;
        "as bug."
 #endif
 
-featurelist_t *first_feature = NULL;
+static featurelist_t *first_feature = NULL;
 static ignorelist_t *sensor_list;
 
 #if SENSORS_API_VERSION < 0x400
@@ -378,7 +378,7 @@ static int sensors_load_conf (void)
                                continue;
                        }
 
-                       fl = (featurelist_t *) malloc (sizeof (featurelist_t));
+                       fl = malloc (sizeof (*fl));
                        if (fl == NULL)
                        {
                                ERROR ("sensors plugin: malloc failed.");
@@ -435,7 +435,7 @@ static int sensors_load_conf (void)
                                                && (subfeature->type != SENSORS_SUBFEATURE_POWER_INPUT))
                                        continue;
 
-                               fl = (featurelist_t *) malloc (sizeof (featurelist_t));
+                               fl = malloc (sizeof (*fl));
                                if (fl == NULL)
                                {
                                        ERROR ("sensors plugin: malloc failed.");