From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:39:57 +0000 (+0200) Subject: write_redis plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=07cb8cc99f1f1992faf0be8571e07632abe7f931;p=collectd.git write_redis plugin: malloc + memset -> calloc --- diff --git a/src/write_redis.c b/src/write_redis.c index 4bfcc73d..a79eb36b 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -171,10 +171,9 @@ static int wr_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)); node->host = NULL; node->port = 0; node->timeout.tv_sec = 0;