X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_mongodb.c;h=8d9ed9df39bc5099c27e21eb02fa4dcbe7ed1e74;hb=4103105fb43cd72294f165b2541540b3a8a99532;hp=24151ceb720a3a29a055a0a24e7cdc6993661d45;hpb=2daef0be77f9a49287432a22ba0d04494602588d;p=collectd.git diff --git a/src/write_mongodb.c b/src/write_mongodb.c index 24151ceb..8d9ed9df 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -29,13 +29,12 @@ **/ #include "collectd.h" + #include "plugin.h" #include "common.h" #include "configfile.h" #include "utils_cache.h" -#include - #if HAVE_STDINT_H # define MONGO_HAVE_STDINT 1 #else @@ -274,10 +273,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;