From: Christian Brauner Date: Sat, 24 Feb 2018 14:26:35 +0000 (+0100) Subject: lxccontainer: lxcapi_startl() X-Git-Tag: lxc-3.0.0.beta1~15^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f52e3317de797341bbda37829831fbe17ff5c89;p=thirdparty%2Flxc.git lxccontainer: lxcapi_startl() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 602653b71..730cfa237 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1108,9 +1108,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; @@ -1126,16 +1124,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++) @@ -1144,6 +1139,7 @@ out: } current_config = NULL; + return bret; }