about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index e68237948..ca9cf0f4d 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1980,6 +1980,7 @@ addfd(int forked, int *save, struct multio **mfds, int fd1, int fd2, int rflag,
 		     */
 		    if (fdN < 0 && errno != EBADF) {
 			zerr("cannot duplicate fd %d: %e", fd1, errno);
+			mfds[fd1] = NULL;
 			closemnodes(mfds);
 			return;
 		    }