e2fsprogs/6002-e2fsck-fix-fd-leak-in-reserve_stdio_fds.patch
2019-09-30 10:37:40 -04:00

31 lines
739 B
Diff

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