projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac7b627
)
filecount plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 14:01:27 +0000
(16:01 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 14:01:27 +0000
(16:01 +0200)
src/filecount.c
patch
|
blob
|
history
diff --git
a/src/filecount.c
b/src/filecount.c
index
7c96a48
..
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' */
- dir =
malloc (
sizeof (*dir));
+ dir =
calloc (1,
sizeof (*dir));
if (dir == NULL)
{
- ERROR ("filecount plugin:
m
alloc failed.");
+ ERROR ("filecount plugin:
c
alloc failed.");
return (-1);
}
- memset (dir, 0, sizeof (*dir));
dir->path = strdup (ci->values[0].value.string);
if (dir->path == NULL)