Blame SOURCES/e2fsprogs-1.42.9-14-e2fsck-fix-fd-leak-in-reserve_stdio_fds.patch

98901c
From a2a3247ba03bcb37f80b04b473112079968b9513 Mon Sep 17 00:00:00 2001
98901c
From: Theodore Ts'o <tytso@mit.edu>
98901c
Date: Sat, 11 Aug 2018 20:47:08 -0400
98901c
Subject: [PATCH 10/16] e2fsck: fix fd leak in reserve_stdio_fds
98901c
98901c
commit ac5936d78d520b9edac15994728bb8b0364814e6
98901c
98901c
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
98901c
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
98901c
---
98901c
 e2fsck/unix.c | 3 ++-
98901c
 1 file changed, 2 insertions(+), 1 deletion(-)
98901c
98901c
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
98901c
index 5fcc9d99..a434f1e6 100644
98901c
--- a/e2fsck/unix.c
98901c
+++ b/e2fsck/unix.c
98901c
@@ -604,9 +604,10 @@ static void reserve_stdio_fds(void)
98901c
 			fprintf(stderr, _("ERROR: Couldn't open "
98901c
 				"/dev/null (%s)\n"),
98901c
 				strerror(errno));
98901c
-			break;
98901c
+			return;
98901c
 		}
98901c
 	}
98901c
+	(void) close(fd);
98901c
 }
98901c
 
98901c
 #ifdef HAVE_SIGNAL_H
98901c
-- 
98901c
2.20.1
98901c