summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/exec.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ed44bcf26..009c33e30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2018-11-09  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* 43792: Kamil: Src/exec.c: file descriptor could leak on fork error.
+
 	* 43793: Kamil: Src/Zle/computil.c: could overrun buffer by 1 byte.
 
 	* 43791: Kamil: Src/Modules/clone.c: file descriptor was closed twice.
diff --git a/Src/exec.c b/Src/exec.c
index c4a2740c0..042ba065a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4805,7 +4805,8 @@ getoutputfile(char *cmd, char **eptr)
     }
 
     if ((cmdoutpid = pid = zfork(NULL)) == -1) {
-	/* fork or open error */
+	/* fork error */
+	close(fd);
 	child_unblock();
 	return nam;
     } else if (pid) {