aboutsummaryrefslogtreecommitdiff
path: root/lib/libutil
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-12-28 05:33:59 +0000
committerWarner Losh <imp@FreeBSD.org>2017-12-28 05:33:59 +0000
commit7e8fba78890a6a52dc45dd49ec9f42480484b763 (patch)
tree7738a6ffb58db02b6ea9d2317756c762fe1b2d32 /lib/libutil
parent076950009fa8372d0084a4c281478d412fdedeec (diff)
Notes
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/pty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c
index 1ef445a7b3b4..8faf91545380 100644
--- a/lib/libutil/pty.c
+++ b/lib/libutil/pty.c
@@ -101,12 +101,13 @@ forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp)
return (-1);
switch (pid = fork()) {
case -1:
+ (void)close(slave);
return (-1);
case 0:
/*
* child
*/
- (void) close(master);
+ (void)close(master);
login_tty(slave);
return (0);
}