From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:37:52 +0000 (+0200) Subject: write_mongodb plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~4 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=0bd857dd5aec94cd6b6fb18b58953bc2663122d1;hp=a11ccccef0da1effb0f6c07a3a3db0f6d46fac0f;p=collectd.git write_mongodb plugin: malloc + memset -> calloc --- 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;