summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2016-03-16 16:16:09 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-03-31 18:38:53 -0400
commit34c950be679717296ab8224c1a4dbc50d4d92a6f (patch)
tree96401be473d287cf9339061285aed99ca442f747
parent827c67a4d3c72a230a9af264c0e32f9d9a224866 (diff)
downloadmongo-34c950be679717296ab8224c1a4dbc50d4d92a6f.tar.gz
SERVER-22869 Guard against an already saved cursor in WT RandomCursor
(cherry picked from commit 4d24b36e82e5b2ddba32b30c5bc2499d635d1397)
-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 75c9bf31907..7edd75781c5 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 {