diff options
author | Geert Bosch <geert@mongodb.com> | 2016-03-16 16:16:09 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2016-03-31 16:41:09 -0400 |
commit | 4d24b36e82e5b2ddba32b30c5bc2499d635d1397 (patch) | |
tree | 5accbb1941564bd65454d9566bb0d8f9e42c3619 | |
parent | a53618a1099199e8fbd3e66996826a26528444d5 (diff) | |
download | mongo-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.cpp | 4 |
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 { |