diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-02-09 20:10:03 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-02-09 20:10:03 +0100 |
commit | 058db925289175e49d981b2beab7fd9a5e817ea6 (patch) | |
tree | 3a7e024dcc31c5ef0f6313ce7be3293472697b54 | |
parent | a09d3eafac72435e87ad34a4129a4c414b684e3e (diff) |
dropin: always initialize return parameters on success
Just as a matter of coding style: whenever we return successfully, let's
make sure all our return parameters are properly initialized to
something.
-rw-r--r-- | src/shared/dropin.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/shared/dropin.c b/src/shared/dropin.c index d645a6a5ba..15ccd1b6ca 100644 --- a/src/shared/dropin.c +++ b/src/shared/dropin.c @@ -185,27 +185,30 @@ int unit_file_find_dropin_paths( const char *dir_suffix, const char *file_suffix, Set *names, - char ***paths) { + char ***ret) { _cleanup_strv_free_ char **dirs = NULL, **ans = NULL; Iterator i; char *t, **p; int r; - assert(paths); + assert(ret); SET_FOREACH(t, names, i) STRV_FOREACH(p, lookup_path) unit_file_find_dirs(original_root, unit_path_cache, *p, t, dir_suffix, &dirs); - if (strv_isempty(dirs)) + if (strv_isempty(dirs)) { + *ret = NULL; return 0; + } r = conf_files_list_strv(&ans, file_suffix, NULL, (const char**) dirs); if (r < 0) return log_warning_errno(r, "Failed to sort the list of configuration files: %m"); - *paths = ans; + *ret = ans; ans = NULL; + return 1; } |