projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
442050c
)
modbus plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 15:12:14 +0000
(17:12 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 15:12:14 +0000
(17:12 +0200)
src/modbus.c
patch
|
blob
|
history
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;
- 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));