From: Christian Brauner Date: Fri, 29 Jan 2021 13:24:31 +0000 (+0100) Subject: attach: move new_cwd into tighter scope X-Git-Tag: lxc-5.0.0~313^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26abd7eacac6d203ae9721e2bf825a3a50b844c8;p=thirdparty%2Flxc.git attach: move new_cwd into tighter scope Signed-off-by: Christian Brauner --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 382467237..1b47fdc81 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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; @@ -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]);