Unverified Commit 4fe9a9b7 by Christian Brauner Committed by GitHub

Merge pull request #2000 from hallyn/2017-12-04/execargs

lxc_execute: properly figure out number of needed arguments
parents 68eeee2f 858faf70
......@@ -49,14 +49,14 @@ static int execute_start(struct lxc_handler *handler, void* data)
while (my_args->argv[argc++]);
argc_add = 4;
/* lxc-init -n name -- [argc] NULL -> 5 */
argc_add = 5;
if (my_args->quiet)
argc_add++;
if (!handler->conf->rootfs.path) {
argc_add += 4;
if (lxc_log_has_valid_level())
argc_add += 2;
}
if (!handler->conf->rootfs.path)
argc_add += 2;
if (lxc_log_has_valid_level())
argc_add += 2;
argv = malloc((argc + argc_add) * sizeof(*argv));
if (!argv)
......
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