X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwrite_mongodb.c;h=9a6fdf2697da4b52c7ba7d5fd5f8f39ed96c73c6;hb=644786a90e054facf2ba1a393f1e4a86c2bee0c5;hp=24151ceb720a3a29a055a0a24e7cdc6993661d45;hpb=cfe801cf0236ea2fade924e0f2b5ce3d1a51698a;p=collectd.git diff --git a/src/write_mongodb.c b/src/write_mongodb.c index 24151ceb..9a6fdf26 100644 --- 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;