lxccontainer: lxcapi_startl()

parent 0c14779f
...@@ -1108,9 +1108,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, ...@@ -1108,9 +1108,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit,
return ret; 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, ...) static bool lxcapi_startl(struct lxc_container *c, int useinit, ...)
{ {
va_list ap; va_list ap;
...@@ -1126,16 +1124,13 @@ static bool lxcapi_startl(struct lxc_container *c, int useinit, ...) ...@@ -1126,16 +1124,13 @@ static bool lxcapi_startl(struct lxc_container *c, int useinit, ...)
va_start(ap, useinit); va_start(ap, useinit);
inargs = lxc_va_arg_list_to_argv(ap, 0, 1); inargs = lxc_va_arg_list_to_argv(ap, 0, 1);
va_end(ap); va_end(ap);
if (!inargs)
if (!inargs) { goto on_error;
ERROR("Memory allocation error.");
goto out;
}
/* pass NULL if no arguments were supplied */ /* pass NULL if no arguments were supplied */
bret = do_lxcapi_start(c, useinit, *inargs ? inargs : NULL); bret = do_lxcapi_start(c, useinit, *inargs ? inargs : NULL);
out: on_error:
if (inargs) { if (inargs) {
char **arg; char **arg;
for (arg = inargs; *arg; arg++) for (arg = inargs; *arg; arg++)
...@@ -1144,6 +1139,7 @@ out: ...@@ -1144,6 +1139,7 @@ out:
} }
current_config = NULL; current_config = NULL;
return bret; return bret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment