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

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