]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] Fix fd leak
authorScott James Remnant <scott@netsplit.com>
Fri, 4 Dec 2009 16:02:31 +0000 (11:02 -0500)
committerRay Strode <rstrode@redhat.com>
Fri, 4 Dec 2009 16:02:31 +0000 (11:02 -0500)
When redirecting stdio to the tty, the
tty was opened and its fd was dup()'d to
the standard ones, but then wasn't closed.

src/main.c

index 95dc9fe354a32aa1b0414c8c2fa09d9fb28a8c8e..36f294813dd4cbe4da3dd1f305d99f5e03d9dcb5 100644 (file)
@@ -1403,6 +1403,8 @@ redirect_standard_io_to_device (const char *device)
   dup2 (fd, STDOUT_FILENO);
   dup2 (fd, STDERR_FILENO);
 
+  close (fd);
+
   return true;
 }