projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a11cccc
)
write_mongodb plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:37:52 +0000
(18:37 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:37:52 +0000
(18:37 +0200)
src/write_mongodb.c
patch
|
blob
|
history
diff --git
a/src/write_mongodb.c
b/src/write_mongodb.c
index
24151ce
..
9a6fdf2
100644
(file)
--- a/
src/write_mongodb.c
+++ b/
src/write_mongodb.c
@@
-274,10
+274,9
@@
static int wm_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));
mongo_init (node->conn);
node->host = NULL;
node->store_rates = 1;