diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-10-12 16:18:03 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-10-12 16:18:03 +1100 |
commit | af841dda02013ef68c694e965089c367119bb20a (patch) | |
tree | e9a9db7475cd4cb03ebfede6e889a1d9f51eda38 /src/os_posix | |
parent | 3a13d8670eedd7e558ec6999f63cbc30c75cf832 (diff) | |
download | mongo-af841dda02013ef68c694e965089c367119bb20a.tar.gz |
Don't set the returned file handle in __wt_open until after all error checking.
refs #123
Diffstat (limited to 'src/os_posix')
-rw-r--r-- | src/os_posix/os_open.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/os_posix/os_open.c b/src/os_posix/os_open.c index f7dc2d235e0..5aff61bbd71 100644 --- a/src/os_posix/os_open.c +++ b/src/os_posix/os_open.c @@ -90,7 +90,6 @@ __wt_open(WT_SESSION_IMPL *session, fh->fd = fd; fh->refcnt = 1; - *fhp = fh; /* Set the file's size. */ WT_ERR(__wt_filesize(session, fh, &fh->file_size)); @@ -100,6 +99,8 @@ __wt_open(WT_SESSION_IMPL *session, TAILQ_INSERT_TAIL(&conn->fhqh, fh, q); __wt_unlock(session, conn->mtx); + *fhp = fh; + if (0) { err: if (fh != NULL) { __wt_free(session, fh->name); |