util: when we use path_strv_canonicalize() we must allocate the strv from the heap

This commit is contained in:
Lennart Poettering
2013-10-30 18:15:38 +01:00
parent d21ed1ead1
commit 8201ad81a0
+8 -2
View File
@@ -148,12 +148,18 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char *root, con
}
int conf_files_list(char ***strv, const char *suffix, const char *root, const char *dir, ...) {
char **dirs;
_cleanup_strv_free_ char **dirs = NULL;
va_list ap;
assert(strv);
assert(suffix);
dirs = strv_from_stdarg_alloca(dir);
va_start(ap, dir);
dirs = strv_new_ap(dir, ap);
va_end(ap);
if (!dirs)
return -ENOMEM;
return conf_files_list_strv_internal(strv, suffix, root, dirs);
}