summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott James Remnant <scott@netsplit.com>2009-12-04 11:02:31 -0500
committerRay Strode <rstrode@redhat.com>2009-12-04 11:02:31 -0500
commit7899b6092a482a42fe828cbaf752c4b06cf1b02c (patch)
tree481f58126bcdf776c0a8aee878886a3c0c636f77
parent9ed3080fc6d70b70f974d64fc20c46d1b683f2b2 (diff)
[main] Fix fd leak
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.
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 95dc9fe3..36f29481 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1403,6 +1403,8 @@ redirect_standard_io_to_device (const char *device)
dup2 (fd, STDOUT_FILENO);
dup2 (fd, STDERR_FILENO);
+ close (fd);
+
return true;
}