From: Donghwa Jeong Date: Tue, 19 Jun 2018 01:27:33 +0000 (+0900) Subject: fix fd handle leak X-Git-Tag: lxc-2.0.10~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=743a299439149aee308d6a882de315aab639e551;p=thirdparty%2Flxc.git fix fd handle leak Signed-off-by: Donghwa Jeong --- diff --git a/src/lxc/tools/lxc_usernsexec.c b/src/lxc/tools/lxc_usernsexec.c index 454b664a2..316eaafcd 100644 --- a/src/lxc/tools/lxc_usernsexec.c +++ b/src/lxc/tools/lxc_usernsexec.c @@ -91,6 +91,7 @@ static void opentty(const char * tty, int which) { flags &= ~O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { printf("WARN: could not set fd flags: %s\n", strerror(errno)); + close(fd); return; }