X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_mongodb.c;h=fb80ba28eeb7370b0c4689a07448da37522e6cc0;hb=95dcf60c822e4ab92c0dd1a7ff6cba73bc55bcd1;hp=24151ceb720a3a29a055a0a24e7cdc6993661d45;hpb=e9ef1a2f33fb6fb5a379f877fb8c5bb0d3810fed;p=collectd.git diff --git a/src/write_mongodb.c b/src/write_mongodb.c index 24151ceb..fb80ba28 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -34,8 +34,6 @@ #include "configfile.h" #include "utils_cache.h" -#include - #if HAVE_STDINT_H # define MONGO_HAVE_STDINT 1 #else @@ -274,10 +272,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;