File: upstream-806cc11008.diff

package info (click to toggle)
tmux 1.9-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,912 kB
  • ctags: 3,263
  • sloc: ansic: 32,468; sh: 4,311; awk: 339; makefile: 248
file content (26 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 806cc1100820babca87a4743b31dc07e40ff567c Mon Sep 17 00:00:00 2001
From: nicm <nicm>
Date: Mon, 14 Apr 2014 22:27:30 +0000
Subject: [PATCH 1/6] Don't leak socketpair file descriptors if fork fails.
 Spotted by Balazs Kezes.

---
 job.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/job.c b/job.c
index d7bd852..47f25d0 100644
--- a/job.c
+++ b/job.c
@@ -59,6 +59,8 @@ job_run(const char *cmd, struct session *s,
 	switch (pid = fork()) {
 	case -1:
 		environ_free(&env);
+		close(out[0]);
+		close(out[1]);
 		return (NULL);
 	case 0:		/* child */
 		clear_signals(1);
-- 
1.9.2