projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewide: cleanup malloc calls
[collectd.git]
/
src
/
filecount.c
diff --git
a/src/filecount.c
b/src/filecount.c
index
47caf93
..
7c96a48
100644
(file)
--- a/
src/filecount.c
+++ b/
src/filecount.c
@@
-344,7
+344,7
@@
static int fc_config_add_dir (oconfig_item_t *ci)
}
/* Initialize `dir' */
}
/* Initialize `dir' */
- dir =
(fc_directory_conf_t *)
malloc (sizeof (*dir));
+ dir = malloc (sizeof (*dir));
if (dir == NULL)
{
ERROR ("filecount plugin: malloc failed.");
if (dir == NULL)
{
ERROR ("filecount plugin: malloc failed.");
@@
-356,6
+356,7
@@
static int fc_config_add_dir (oconfig_item_t *ci)
if (dir->path == NULL)
{
ERROR ("filecount plugin: strdup failed.");
if (dir->path == NULL)
{
ERROR ("filecount plugin: strdup failed.");
+ sfree (dir);
return (-1);
}
return (-1);
}