Skip to content

Commit

Permalink
lxccontainer: lxcapi_startl()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent 05583a2 commit 9a007b4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/lxc/lxccontainer.c
Expand Up @@ -1077,9 +1077,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit,
return ret;
}

/*
* note there MUST be an ending NULL
*/
/* Note, there MUST be an ending NULL. */
static bool lxcapi_startl(struct lxc_container *c, int useinit, ...)
{
va_list ap;
Expand All @@ -1095,16 +1093,13 @@ static bool lxcapi_startl(struct lxc_container *c, int useinit, ...)
va_start(ap, useinit);
inargs = lxc_va_arg_list_to_argv(ap, 0, 1);
va_end(ap);

if (!inargs) {
ERROR("Memory allocation error.");
goto out;
}
if (!inargs)
goto on_error;

/* pass NULL if no arguments were supplied */
bret = do_lxcapi_start(c, useinit, *inargs ? inargs : NULL);

out:
on_error:
if (inargs) {
char **arg;
for (arg = inargs; *arg; arg++)
Expand All @@ -1113,6 +1108,7 @@ static bool lxcapi_startl(struct lxc_container *c, int useinit, ...)
}

current_config = NULL;

return bret;
}

Expand Down

0 comments on commit 9a007b4

Please sign in to comment.