summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBosko Milekic <bmilekic@FreeBSD.org>2002-08-13 16:08:07 +0000
committerBosko Milekic <bmilekic@FreeBSD.org>2002-08-13 16:08:07 +0000
commitdf924d72dbee0e2d05e3b1a42fdd3e7aca19d294 (patch)
treed809da40a7cb744e594bae4806d1e8216d3c4482 /lib
parentda637a87919d0d60581fff6a2d8dc3ad6f0534f6 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdtime/localtime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c
index 9f0af0207310..51308dbf1854 100644
--- a/lib/libc/stdtime/localtime.c
+++ b/lib/libc/stdtime/localtime.c
@@ -315,8 +315,10 @@ register struct state * const sp;
return -1;
if ((fid = _open(name, OPEN_MODE)) == -1)
return -1;
- if ((fstat(fid, &stab) < 0) || !S_ISREG(stab.st_mode))
+ if ((fstat(fid, &stab) < 0) || !S_ISREG(stab.st_mode)) {
+ _close(fid);
return -1;
+ }
}
{
struct tzhead * tzhp;