projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0bd857d
)
write_redis plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:39:57 +0000
(18:39 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:39:57 +0000
(18:39 +0200)
src/write_redis.c
patch
|
blob
|
history
diff --git
a/src/write_redis.c
b/src/write_redis.c
index
4bfcc73
..
a79eb36
100644
(file)
--- a/
src/write_redis.c
+++ b/
src/write_redis.c
@@
-171,10
+171,9
@@
static int wr_config_node (oconfig_item_t *ci) /* {{{ */
int status;
int i;
- node =
malloc (
sizeof (*node));
+ node =
calloc (1,
sizeof (*node));
if (node == NULL)
return (ENOMEM);
- memset (node, 0, sizeof (*node));
node->host = NULL;
node->port = 0;
node->timeout.tv_sec = 0;