core: execute - don't leak strv
This commit is contained in:
parent
24119cf10c
commit
e63ff941ea
|
@ -2567,8 +2567,8 @@ int exec_command_set(ExecCommand *c, const char *path, ...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int exec_command_append(ExecCommand *c, const char *path, ...) {
|
int exec_command_append(ExecCommand *c, const char *path, ...) {
|
||||||
|
_cleanup_strv_free_ char **l = NULL;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
char **l;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(c);
|
assert(c);
|
||||||
|
@ -2582,10 +2582,8 @@ int exec_command_append(ExecCommand *c, const char *path, ...) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
r = strv_extend_strv(&c->argv, l);
|
r = strv_extend_strv(&c->argv, l);
|
||||||
if (r < 0) {
|
if (r < 0)
|
||||||
strv_free(l);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue