projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
target plugins: malloc + memset -> calloc
[collectd.git]
/
src
/
modbus.c
diff --git
a/src/modbus.c
b/src/modbus.c
index
d538fb3
..
2605ec2
100644
(file)
--- 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;
int status;
int i;
- host =
malloc (
sizeof (*host));
+ host =
calloc (1,
sizeof (*host));
if (host == NULL)
return (ENOMEM);
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));
host->slaves = NULL;
status = cf_util_get_string_buffer (ci, host->host, sizeof (host->host));