projects
/
krb5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
459a6c1
)
Check fstat result. Close fd on error
author
Ken Raeburn
<raeburn@mit.edu>
Wed, 6 Aug 2008 18:47:06 +0000
(18:47 +0000)
committer
Ken Raeburn
<raeburn@mit.edu>
Wed, 6 Aug 2008 18:47:06 +0000
(18:47 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20624
dc483132
-0cff-0310-8789-
dd5450dbe970
src/lib/kdb/kdb_log.c
patch
|
blob
|
history
diff --git
a/src/lib/kdb/kdb_log.c
b/src/lib/kdb/kdb_log.c
index be5853ccc574656ae8f361eb6b1d92a6dc049594..8d24857ab367ade5673f497fd155bfc842ba4546 100644
(file)
--- a/
src/lib/kdb/kdb_log.c
+++ b/
src/lib/kdb/kdb_log.c
@@
-590,7
+590,10
@@
ulog_map(krb5_context context, const char *logname, uint32_t ulogentries,
}
if (caller == FKPROPLOG) {
- fstat(ulogfd, &st);
+ if (fstat(ulogfd, &st) < 0) {
+ close(ulogfd);
+ return errno;
+ }
ulog_filesize = st.st_size;
ulog = (kdb_hlog_t *)mmap(0, ulog_filesize,
@@
-607,6
+610,7
@@
ulog_map(krb5_context context, const char *logname, uint32_t ulogentries,
/*
* Can't map update log file to memory
*/
+ close(ulogfd);
return (errno);
}