X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ffilecount.c;h=3b5038cde2390f036734c87cccab87f2b186146b;hb=d7ddea73a881d194933bbfbfd0e13efff8ac9296;hp=9ea8af7abe2792ebc7235094cb67f37e75a668e8;hpb=ea3a86f0ff50f12650aae7eea033984a8ae0eba5;p=collectd.git diff --git a/src/filecount.c b/src/filecount.c index 9ea8af7a..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 = (fc_directory_conf_t *) 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)