projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.spec: fix rpmlint warning
[collectd.git]
/
src
/
ethstat.c
diff --git
a/src/ethstat.c
b/src/ethstat.c
index
ee6979c
..
8971f4d
100644
(file)
--- a/
src/ethstat.c
+++ b/
src/ethstat.c
@@
-73,7
+73,7
@@
static int ethstat_add_interface (const oconfig_item_t *ci) /* {{{ */
return (status);
interfaces_num++;
return (status);
interfaces_num++;
- INFO("ethstat plugin: Registred interface %s",
+ INFO("ethstat plugin: Regist
e
red interface %s",
interfaces[interfaces_num - 1]);
return (0);
interfaces[interfaces_num - 1]);
return (0);
@@
-104,14
+104,13
@@
static int ethstat_add_map (const oconfig_item_t *ci) /* {{{ */
return (ENOMEM);
}
return (ENOMEM);
}
- map =
malloc (
sizeof (*map));
+ map =
calloc (1,
sizeof (*map));
if (map == NULL)
{
sfree (key);
if (map == NULL)
{
sfree (key);
- ERROR ("ethstat plugin:
malloc(3)
failed.");
+ ERROR ("ethstat plugin:
calloc
failed.");
return (ENOMEM);
}
return (ENOMEM);
}
- memset (map, 0, sizeof (*map));
sstrncpy (map->type, ci->values[1].value.string, sizeof (map->type));
if (ci->values_num == 3)
sstrncpy (map->type, ci->values[1].value.string, sizeof (map->type));
if (ci->values_num == 3)
@@
-273,7
+272,7
@@
static int ethstat_read_interface (char *device)
close (fd);
sfree (strings);
sfree (stats);
close (fd);
sfree (strings);
sfree (stats);
- ERROR("ethstat plugin: malloc
(3)
failed.");
+ ERROR("ethstat plugin: malloc failed.");
return (-1);
}
return (-1);
}