summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>2002-05-03 17:28:28 +0000
committerGarrett Wollman <wollman@FreeBSD.org>2002-05-03 17:28:28 +0000
commit0d84b47e9cbf5a6a2ebab6ff9679ffa6eb5e5db2 (patch)
treefdfef76bf125040512e7fe45b9fbe9907b52a7f3
parentb9b03ba0bc38e14228189bc0232e730c2a06f208 (diff)
Notes
-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 09cfd3ff7779..4f36f2b451a4 100644
--- a/lib/libc/stdtime/localtime.c
+++ b/lib/libc/stdtime/localtime.c
@@ -316,8 +316,10 @@ 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;