projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filecount plugin: malloc + memset -> calloc
[collectd.git]
/
src
/
filecount.c
diff --git
a/src/filecount.c
b/src/filecount.c
index
9ea8af7
..
3b5038c
100644
(file)
--- a/
src/filecount.c
+++ b/
src/filecount.c
@@
-344,13
+344,12
@@
static int fc_config_add_dir (oconfig_item_t *ci)
}
/* Initialize `dir' */
}
/* Initialize `dir' */
- dir =
(fc_directory_conf_t *) malloc (
sizeof (*dir));
+ dir =
calloc (1,
sizeof (*dir));
if (dir == NULL)
{
if (dir == NULL)
{
- ERROR ("filecount plugin:
m
alloc failed.");
+ ERROR ("filecount plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (dir, 0, sizeof (*dir));
dir->path = strdup (ci->values[0].value.string);
if (dir->path == NULL)
dir->path = strdup (ci->values[0].value.string);
if (dir->path == NULL)