summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-30 18:15:38 +0100
committerLennart Poettering <lennart@poettering.net>2013-10-30 18:15:38 +0100
commit8201ad81a033aff8526e489300e16c0011451330 (patch)
tree8d78fa93af7839157b50f7f4d31e4369c52fe289 /src
parentd21ed1ead18d16d35c30299a69d3366847f8a039 (diff)
util: when we use path_strv_canonicalize() we must allocate the strv from the heap
Diffstat (limited to 'src')
-rw-r--r--src/shared/conf-files.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 7ba4bee43b..ed4070c662 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -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);
}