Skip to content

Commit b40997b

Browse files
neuschaefertorvalds
authored andcommitted
um: drivers/xterm.c: fix a file descriptor leak
I could use out_close1, but that seems to be the code path to close the fd returned by os_create_unix_socket, and using it to close the fd returned by mkstemp might lead to some confusion, so I don't do it. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e5f0bdc commit b40997b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎arch/um/drivers/xterm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static int xterm_open(int input, int output, int primary, void *d,
123123
err = -errno;
124124
printk(UM_KERN_ERR "xterm_open : unlink failed, errno = %d\n",
125125
errno);
126+
close(fd);
126127
return err;
127128
}
128129
close(fd);

0 commit comments

Comments
 (0)