about summary refs log tree commit diff
path: root/src/usr.bin/calendar/io.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-09-03 17:42:37 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-09-03 17:42:37 +0200
commitc1f86bc3033b6f7225147e185d6b1842cf22252d (patch)
treef44641c8254d95126b3465c2dc0e6f281e193873 /src/usr.bin/calendar/io.c
parent09b4651bbe5b242f2105739a2af7604745d05a02 (diff)
downloadoutils-c1f86bc3033b6f7225147e185d6b1842cf22252d.tar.gz
outils-c1f86bc3033b6f7225147e185d6b1842cf22252d.tar.xz
outils-c1f86bc3033b6f7225147e185d6b1842cf22252d.zip
cvs update
Diffstat (limited to 'src/usr.bin/calendar/io.c')
-rw-r--r--src/usr.bin/calendar/io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/usr.bin/calendar/io.c b/src/usr.bin/calendar/io.c
index f17cacb..e4cb689 100644
--- a/src/usr.bin/calendar/io.c
+++ b/src/usr.bin/calendar/io.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: io.c,v 1.43 2015/12/08 19:04:50 mmcc Exp $	*/
+/*	$OpenBSD: io.c,v 1.44 2016/08/31 09:38:47 jsg Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -335,12 +335,15 @@ opencal(void)
 		}
 	}
 
-	if (pipe(pdes) < 0)
+	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);