projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/daemon/common.c: Add unit test for escape_string().
[collectd.git]
/
src
/
daemon
/
configfile.c
diff --git
a/src/daemon/configfile.c
b/src/daemon/configfile.c
index
f34adae
..
f367ee9
100644
(file)
--- a/
src/daemon/configfile.c
+++ b/
src/daemon/configfile.c
@@
-156,9
+156,12
@@
static int cf_dispatch (const char *type, const char *orig_key,
int ret;
int i;
int ret;
int i;
+ if (orig_key == NULL)
+ return (EINVAL);
+
DEBUG ("type = %s, key = %s, value = %s",
ESCAPE_NULL(type),
DEBUG ("type = %s, key = %s, value = %s",
ESCAPE_NULL(type),
-
ESCAPE_NULL(orig_key)
,
+
orig_key
,
ESCAPE_NULL(orig_value));
if ((cf_cb = cf_search (type)) == NULL)
ESCAPE_NULL(orig_value));
if ((cf_cb = cf_search (type)) == NULL)
@@
-199,8
+202,6
@@
static int cf_dispatch (const char *type, const char *orig_key,
free (key);
free (value);
free (key);
free (value);
- DEBUG ("cf_dispatch: return (%i)", ret);
-
return (ret);
} /* int cf_dispatch */
return (ret);
} /* int cf_dispatch */
@@
-759,6
+760,9
@@
static oconfig_item_t *cf_read_dir (const char *dir,
filenames[filenames_num - 1] = sstrdup (name);
}
filenames[filenames_num - 1] = sstrdup (name);
}
+ if (filenames == NULL)
+ return (root);
+
qsort ((void *) filenames, filenames_num, sizeof (*filenames),
cf_compare_string);
qsort ((void *) filenames, filenames_num, sizeof (*filenames),
cf_compare_string);