Fix descriptor leak in getty()

Found by Coverity Scan.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-09-04 23:03:42 +02:00
parent 512a07a25c
commit 4aa569de44
+1
View File
@@ -306,6 +306,7 @@ int getty(char *tty, char *baud, char *UNUSED(term), char *user)
sigaction(SIGQUIT, &sa, NULL);
stty(fd, speed);
close(fd);
utmp_set_login(tty, NULL);
if (!user)