]> git.proxmox.com Git - mirror_lxc.git/commitdiff
fix fd handle leak
authorDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 19 Jun 2018 01:27:33 +0000 (10:27 +0900)
committerDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 19 Jun 2018 01:27:33 +0000 (10:27 +0900)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/lxc/cmd/lxc_usernsexec.c

index 56e1bdbcb2c314c70118076fe2ed3a75555bfd04..cfe5db26c945374895e112511cd5b719ae4fcbf3 100644 (file)
@@ -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;
        }