From: Ruben Kerkhof Date: Fri, 1 Apr 2016 15:12:14 +0000 (+0200) Subject: modbus plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~31 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=665099d3913062f7deec6ff9956a2febc5843a63;p=collectd.git modbus plugin: malloc + memset -> calloc --- diff --git a/src/modbus.c b/src/modbus.c index d538fb3f..2605ec23 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -938,10 +938,9 @@ static int mb_config_add_host (oconfig_item_t *ci) /* {{{ */ int status; int i; - host = malloc (sizeof (*host)); + host = calloc (1, sizeof (*host)); if (host == NULL) return (ENOMEM); - memset (host, 0, sizeof (*host)); host->slaves = NULL; status = cf_util_get_string_buffer (ci, host->host, sizeof (host->host));