lxccontainer: push_arg()

parent 6b0297e3
...@@ -707,15 +707,17 @@ static bool am_single_threaded(void) ...@@ -707,15 +707,17 @@ static bool am_single_threaded(void)
static void push_arg(char ***argp, char *arg, int *nargs) static void push_arg(char ***argp, char *arg, int *nargs)
{ {
char **argv;
char *copy; char *copy;
char **argv;
do { do {
copy = strdup(arg); copy = strdup(arg);
} while (!copy); } while (!copy);
do { do {
argv = realloc(*argp, (*nargs + 2) * sizeof(char *)); argv = realloc(*argp, (*nargs + 2) * sizeof(char *));
} while (!argv); } while (!argv);
*argp = argv; *argp = argv;
argv[*nargs] = copy; argv[*nargs] = copy;
(*nargs)++; (*nargs)++;
......
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