2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 11:29:33 +00:00

lxccontainer: push_arg()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2018-02-24 15:23:03 +01:00
parent 6b0297e327
commit 1452d3fe06

View File

@@ -707,15 +707,17 @@ static bool am_single_threaded(void)
static void push_arg(char ***argp, char *arg, int *nargs)
{
char **argv;
char *copy;
char **argv;
do {
copy = strdup(arg);
} while (!copy);
do {
argv = realloc(*argp, (*nargs + 2) * sizeof(char *));
} while (!argv);
*argp = argv;
argv[*nargs] = copy;
(*nargs)++;