=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/calendar/io.c,v retrieving revision 1.43 retrieving revision 1.44 diff -c -r1.43 -r1.44 *** src/usr.bin/calendar/io.c 2015/12/08 19:04:50 1.43 --- src/usr.bin/calendar/io.c 2016/08/31 09:38:47 1.44 *************** *** 1,4 **** ! /* $OpenBSD: io.c,v 1.43 2015/12/08 19:04:50 mmcc Exp $ */ /* * Copyright (c) 1989, 1993, 1994 --- 1,4 ---- ! /* $OpenBSD: io.c,v 1.44 2016/08/31 09:38:47 jsg Exp $ */ /* * Copyright (c) 1989, 1993, 1994 *************** *** 335,346 **** } } ! if (pipe(pdes) < 0) return (NULL); switch (vfork()) { case -1: /* error */ (void)close(pdes[0]); (void)close(pdes[1]); return (NULL); case 0: dup2(fdin, STDIN_FILENO); --- 335,349 ---- } } ! if (pipe(pdes) < 0) { ! close(fdin); return (NULL); + } switch (vfork()) { case -1: /* error */ (void)close(pdes[0]); (void)close(pdes[1]); + close(fdin); return (NULL); case 0: dup2(fdin, STDIN_FILENO);