From: Theodore Ts'o Date: Sun, 12 Aug 2018 00:47:08 +0000 (-0400) Subject: e2fsck: fix fd leak in reserve_stdio_fds X-Git-Tag: v1.44.4~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ac5936d78d520b9edac15994728bb8b0364814e6;p=tools%2Fe2fsprogs.git e2fsck: fix fd leak in reserve_stdio_fds Signed-off-by: Theodore Ts'o Reviewed-by: Lukas Czerner --- 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