index f34adae319a63928e8346be26e28b0a4dbe8f6ca..ae9ab3a6cfe6bd6679fbc3dadc5ffa5a124fc25f 100644 (file)
--- a/src/daemon/configfile.c
+++ b/src/daemon/configfile.c
int ret;
int i;
+ if (orig_key == NULL)
+ return (EINVAL);
+
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)
free (key);
free (value);
- DEBUG ("cf_dispatch: return (%i)", ret);
-
return (ret);
} /* int cf_dispatch */
return (-1);
/* Now replace the i'th child in `root' with `new'. */
- if (cf_ci_replace_child (root, new, i) < 0)
+ if (cf_ci_replace_child (root, new, i) < 0) {
+ sfree (new->values);
+ sfree (new);
return (-1);
+ }
/* ... and go back to the new i'th child. */
--i;
filenames[filenames_num - 1] = sstrdup (name);
}
+ if (filenames == NULL)
+ return (root);
+
qsort ((void *) filenames, filenames_num, sizeof (*filenames),
cf_compare_string);