summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2020-09-17 18:30:58 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-05 13:56:39 +0000
commit92154af191d67409ab3cf3e0147e7299c63e1216 (patch)
tree47f66992036155182d1d4e00bfecbfa51f744efe /src
parentcc163fc8eba89c87a9cabc7d3dbb2ab41887ccfc (diff)
downloadmongo-92154af191d67409ab3cf3e0147e7299c63e1216.tar.gz
SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free
(cherry picked from commit 0349776028d92914c0502d6419c5e73306b7a170)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/pipeline/document_source_list_local_sessions.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_list_local_sessions.cpp b/src/mongo/db/pipeline/document_source_list_local_sessions.cpp
index c152ce54e32..d9ecb696c28 100644
--- a/src/mongo/db/pipeline/document_source_list_local_sessions.cpp
+++ b/src/mongo/db/pipeline/document_source_list_local_sessions.cpp
@@ -49,9 +49,8 @@ DocumentSource::GetNextResult DocumentSourceListLocalSessions::getNext() {
while (!_ids.empty()) {
const auto& id = _ids.back();
+ const auto record = _cache->peekCached(id);
_ids.pop_back();
-
- const auto& record = _cache->peekCached(id);
if (!record) {
// It's possible for SessionRecords to have expired while we're walking
continue;