strv: introduce new strv_from_stdarg_alloca() macro to generate a string array from stdarg function parameters

This allows us to turn lists of strings passed in easily into string
arrays without having to allocate memory.
This commit is contained in:
Lennart Poettering
2013-10-29 19:53:43 +01:00
parent 7b1132f60d
commit 250a918dc4
5 changed files with 76 additions and 49 deletions
+2 -1
View File
@@ -2214,7 +2214,8 @@ int exec_command_set(ExecCommand *c, const char *path, ...) {
if (!l)
return -ENOMEM;
if (!(p = strdup(path))) {
p = strdup(path);
if (!p) {
strv_free(l);
return -ENOMEM;
}