From 250a918dc4c8a15d927deecc3b3f6a0604657ae4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 29 Oct 2013 19:53:43 +0100 Subject: 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. --- src/core/execute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/execute.c') diff --git a/src/core/execute.c b/src/core/execute.c index e04f46f03..3ae28ee08 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -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; } -- cgit v1.2.3