chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d21ed1e
)
util: when we use path_strv_canonicalize() we must allocate the strv from the heap
author
Lennart Poettering
<lennart@poettering.net>
Wed, 30 Oct 2013 17:15:38 +0000
(18:15 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 30 Oct 2013 17:15:38 +0000
(18:15 +0100)
src/shared/conf-files.c
patch
|
blob
|
history
diff --git
a/src/shared/conf-files.c
b/src/shared/conf-files.c
index 7ba4bee43bbc2efd091c405c6716f2335548eb53..ed4070c662711cb1e3ae7f009b336e3ad9f19b3e 100644
(file)
--- 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);
}