summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-06-11 11:01:21 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-06-11 11:01:21 +1000
commite7001f482e863b5daeb0984677fab1b7b7a88b71 (patch)
tree15f105eae508f72bf8dbda2fb5e64cd76d83b8c7
parent09e7840292ae7f9746ec6b3a3e50d748b0c60f9e (diff)
downloadmongo-e7001f482e863b5daeb0984677fab1b7b7a88b71.tar.gz
Don't increment the data handle reference count if locking the handle fails.
refs #574
-rw-r--r--src/conn/conn_dhandle.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index a02f3690bc3..0cbe9233c8c 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -104,10 +104,11 @@ __conn_dhandle_get(WT_SESSION_IMPL *session,
((ckpt == NULL && dhandle->checkpoint == NULL) ||
(ckpt != NULL && dhandle->checkpoint != NULL &&
strcmp(ckpt, dhandle->checkpoint) == 0))) {
+ WT_RET(__conn_dhandle_open_lock(
+ session, dhandle, flags));
++dhandle->refcnt;
session->dhandle = dhandle;
- return (__conn_dhandle_open_lock(
- session, dhandle, flags));
+ return (0);
}
/*