]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix fd handle leak
authorDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 19 Jun 2018 01:27:33 +0000 (10:27 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 13:28:11 +0000 (14:28 +0100)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/lxc/tools/lxc_usernsexec.c

index 454b664a209ce59ddb9426a9cd5cc73be213f1bc..316eaafcd7a797ce81af54d54deb87782e548243 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;
        }