diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index 1ef445a7b3b..8faf9154538 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); }