Skip to content

Commit

Permalink
attach: move new_cwd into tighter scope
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Jan 29, 2021
1 parent f8e88e9 commit 26abd7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/attach.c
Expand Up @@ -1051,7 +1051,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
int ret_parent = -1;
struct lxc_epoll_descr descr = {};
int ret;
char *name, *lxcpath, *new_cwd;
char *name, *lxcpath;
int ipc_sockets[2];
pid_t attached_pid, pid, to_cleanup_pid;
struct attach_context *ctx;
Expand Down Expand Up @@ -1182,7 +1182,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
}

if (pid == 0) {
char *cwd;
char *cwd, *new_cwd;

/* close unneeded file descriptors */
close_prot_errno_disarm(ipc_sockets[0]);
Expand Down

0 comments on commit 26abd7e

Please sign in to comment.