aboutsummaryrefslogtreecommitdiff
path: root/daemons/getty.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemons/getty.c')
-rw-r--r--daemons/getty.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/daemons/getty.c b/daemons/getty.c
index 40ad4d73..3b0adc48 100644
--- a/daemons/getty.c
+++ b/daemons/getty.c
@@ -68,7 +68,7 @@ load_banner (void)
{
char *buf = NULL, *p;
struct stat st;
- int fd;
+ int fd = -1;
ssize_t remaining, count;
fd = open (_PATH_ISSUE, O_RDONLY);
@@ -101,6 +101,8 @@ load_banner (void)
return buf;
out:
+ if (fd != -1)
+ close (fd);
free (buf);
return "\n\\s \\r (\\n) (\\l)\r\n\n";
}