summaryrefslogtreecommitdiff
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 15:51:58 +0000
commit507a73bdef9a4d6f81ab74d428a3076fbcf28fe5 (patch)
treea5757baa10a6d7235fe68a9b03c7b115e26cce34
parentbc69104ff18946278628bfb0411e68a5132c512a (diff)
downloadmongo-507a73bdef9a4d6f81ab74d428a3076fbcf28fe5.tar.gz
SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free
(cherry picked from commit 0349776028d92914c0502d6419c5e73306b7a170)
-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;