From 72f3b390dff512e8d891aff6f3fba9ecaeaf970c Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:01:27 +0200 Subject: [PATCH] filecount plugin: malloc + memset -> calloc --- src/filecount.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/filecount.c b/src/filecount.c index 7c96a48f..3b5038cd 100644 --- a/src/filecount.c +++ b/src/filecount.c @@ -344,13 +344,12 @@ static int fc_config_add_dir (oconfig_item_t *ci) } /* Initialize `dir' */ - dir = malloc (sizeof (*dir)); + dir = calloc (1, sizeof (*dir)); if (dir == NULL) { - ERROR ("filecount plugin: malloc failed."); + ERROR ("filecount plugin: calloc failed."); return (-1); } - memset (dir, 0, sizeof (*dir)); dir->path = strdup (ci->values[0].value.string); if (dir->path == NULL) -- 2.30.2