summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-30 11:34:01 +0200
committerTom Gundersen <teg@jklm.no>2014-09-30 11:34:01 +0200
commite63ff941eaa012ffd003e3791438c73b8a26227d (patch)
treea307a58f7a2a79e0b949cbdd50d996ba1b05204b
parent24119cf10c7ed58a8fc0851745149dcc6dd5757f (diff)
core: execute - don't leak strv
Notes
execute: fix OOM
-rw-r--r--src/core/execute.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 07ec7a28d..8b9bb2713 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2567,8 +2567,8 @@ int exec_command_set(ExecCommand *c, const char *path, ...) {
}
int exec_command_append(ExecCommand *c, const char *path, ...) {
+ _cleanup_strv_free_ char **l = NULL;
va_list ap;
- char **l;
int r;
assert(c);
@@ -2582,10 +2582,8 @@ int exec_command_append(ExecCommand *c, const char *path, ...) {
return -ENOMEM;
r = strv_extend_strv(&c->argv, l);
- if (r < 0) {
- strv_free(l);
+ if (r < 0)
return r;
- }
return 0;
}