summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e9851b7)
raw | patch | inline | side by side (parent: e9851b7)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 13:59:07 +0000 (15:59 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 13:59:07 +0000 (15:59 +0200) |
src/ethstat.c | patch | blob | history |
diff --git a/src/ethstat.c b/src/ethstat.c
index dec14f3d148962df3b1aaf41eb1f50f0a7a5f92c..8971f4dfcc2cb0cc10dbf7cf4c8e6ca271fbdc52 100644 (file)
--- a/src/ethstat.c
+++ b/src/ethstat.c
return (ENOMEM);
}
- map = malloc (sizeof (*map));
+ map = calloc (1, sizeof (*map));
if (map == NULL)
{
sfree (key);
- ERROR ("ethstat plugin: malloc(3) failed.");
+ ERROR ("ethstat plugin: calloc failed.");
return (ENOMEM);
}
- memset (map, 0, sizeof (*map));
sstrncpy (map->type, ci->values[1].value.string, sizeof (map->type));
if (ci->values_num == 3)
close (fd);
sfree (strings);
sfree (stats);
- ERROR("ethstat plugin: malloc(3) failed.");
+ ERROR("ethstat plugin: malloc failed.");
return (-1);
}