summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d741287)
raw | patch | inline | side by side (parent: d741287)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:15:44 +0000 (18:15 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:15:44 +0000 (18:15 +0200) |
src/sensors.c | patch | blob | history |
diff --git a/src/sensors.c b/src/sensors.c
index 3b453b15ae1d77e203f95ac3414dfd71f15caca5..6125d0bc1b7f49ae1d43eb2ea21e2dd69f34332c 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
continue;
}
- fl = malloc (sizeof (*fl));
+ fl = calloc (1, sizeof (*fl));
if (fl == NULL)
{
- ERROR ("sensors plugin: malloc failed.");
+ ERROR ("sensors plugin: calloc failed.");
continue;
}
- memset (fl, '\0', sizeof (featurelist_t));
fl->chip = chip;
fl->data = feature;
&& (subfeature->type != SENSORS_SUBFEATURE_POWER_INPUT))
continue;
- fl = malloc (sizeof (*fl));
+ fl = calloc (1, sizeof (*fl));
if (fl == NULL)
{
- ERROR ("sensors plugin: malloc failed.");
+ ERROR ("sensors plugin: calloc failed.");
continue;
}
- memset (fl, '\0', sizeof (featurelist_t));
fl->chip = chip;
fl->feature = feature;