From: Ruben Kerkhof Date: Fri, 1 Apr 2016 14:01:27 +0000 (+0200) Subject: filecount plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~39 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=72f3b390dff512e8d891aff6f3fba9ecaeaf970c;p=collectd.git filecount plugin: malloc + memset -> calloc --- 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)