summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0156c30)
raw | patch | inline | side by side (parent: 0156c30)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 4 Dec 2015 22:14:06 +0000 (23:14 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 5 Dec 2015 07:54:30 +0000 (08:54 +0100) |
CID #38006
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
src/configfile.c | patch | blob | history |
diff --git a/src/configfile.c b/src/configfile.c
index 32629e08095cb6849d6d681ca19fc1b918d6e7bb..8139c63123f0bf25eac0922cd1f8e5c5197ae43a 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
if (root == NULL)
{
ERROR ("configfile: malloc failed.");
+ closedir (dh);
return (NULL);
}
memset (root, 0, sizeof (oconfig_item_t));
ERROR ("configfile: Not including `%s/%s' because its"
" name is too long.",
dir, de->d_name);
+ closedir (dh);
for (i = 0; i < filenames_num; ++i)
free (filenames[i]);
free (filenames);
filenames_num * sizeof (*filenames));
if (tmp == NULL) {
ERROR ("configfile: realloc failed.");
+ closedir (dh);
for (i = 0; i < filenames_num - 1; ++i)
free (filenames[i]);
free (filenames);
}
if (filenames == NULL)
+ {
+ closedir (dh);
return (root);
+ }
qsort ((void *) filenames, filenames_num, sizeof (*filenames),
cf_compare_string);
free (name);
}
+ closedir (dh);
free(filenames);
return (root);
} /* oconfig_item_t *cf_read_dir */
-/*
+/*
* cf_read_generic
*
* Path is stat'ed and either cf_read_file or cf_read_dir is called