summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2016-03-16 16:16:09 -0400
committerGeert Bosch <geert@mongodb.com>2016-03-31 16:41:09 -0400
commit4d24b36e82e5b2ddba32b30c5bc2499d635d1397 (patch)
tree5accbb1941564bd65454d9566bb0d8f9e42c3619
parenta53618a1099199e8fbd3e66996826a26528444d5 (diff)
downloadmongo-4d24b36e82e5b2ddba32b30c5bc2499d635d1397.tar.gz
SERVER-22869 Guard against an already saved cursor in WT RandomCursor
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index 3543f4fad7a..39520b31abf 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -708,7 +708,9 @@ public:
void detachFromOperationContext() final {
invariant(_txn);
_txn = nullptr;
- _cursor->close(_cursor);
+ if (_cursor) {
+ invariantWTOK(_cursor->close(_cursor));
+ }
_cursor = nullptr;
}
void reattachToOperationContext(OperationContext* txn) final {