X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fethstat.c;h=8971f4dfcc2cb0cc10dbf7cf4c8e6ca271fbdc52;hb=ff9e11ade5cfabf32c63fb19fc76cbbc4186bc5b;hp=ee6979c52aafd1ca542034adad6002a2a6898ce1;hpb=6a5004f9c4394c8f561ba3b817196e7a50ad7237;p=collectd.git diff --git a/src/ethstat.c b/src/ethstat.c index ee6979c5..8971f4df 100644 --- 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++; - INFO("ethstat plugin: Registred interface %s", + INFO("ethstat plugin: Registered interface %s", interfaces[interfaces_num - 1]); return (0); @@ -104,14 +104,13 @@ static int ethstat_add_map (const oconfig_item_t *ci) /* {{{ */ 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) @@ -273,7 +272,7 @@ static int ethstat_read_interface (char *device) close (fd); sfree (strings); sfree (stats); - ERROR("ethstat plugin: malloc(3) failed."); + ERROR("ethstat plugin: malloc failed."); return (-1); }