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) ...@@ -49,14 +49,14 @@ static int execute_start(struct lxc_handler *handler, void* data)
while (my_args->argv[argc++]); while (my_args->argv[argc++]);
argc_add = 4; /* lxc-init -n name -- [argc] NULL -> 5 */
argc_add = 5;
if (my_args->quiet) if (my_args->quiet)
argc_add++; argc_add++;
if (!handler->conf->rootfs.path) { if (!handler->conf->rootfs.path)
argc_add += 4; argc_add += 2;
if (lxc_log_has_valid_level()) if (lxc_log_has_valid_level())
argc_add += 2; argc_add += 2;
}
argv = malloc((argc + argc_add) * sizeof(*argv)); argv = malloc((argc + argc_add) * sizeof(*argv));
if (!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