diff options
author | Arun Banala <arun.banala@mongodb.com> | 2020-09-17 18:30:58 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-18 07:30:55 +0000 |
commit | 0349776028d92914c0502d6419c5e73306b7a170 (patch) | |
tree | 23b2fbde474de0f7da9f6862de58d0dacaf43ffd /src/mongo/db/pipeline/document_source_list_local_sessions.cpp | |
parent | 43586216b2dcde0b1f13ed1a835e1580b5d681be (diff) | |
download | mongo-0349776028d92914c0502d6419c5e73306b7a170.tar.gz |
SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free
Diffstat (limited to 'src/mongo/db/pipeline/document_source_list_local_sessions.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_list_local_sessions.cpp | 3 |
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 b388ee0e688..24efef4263a 100644 --- a/src/mongo/db/pipeline/document_source_list_local_sessions.cpp +++ b/src/mongo/db/pipeline/document_source_list_local_sessions.cpp @@ -44,9 +44,8 @@ REGISTER_DOCUMENT_SOURCE(listLocalSessions, DocumentSource::GetNextResult DocumentSourceListLocalSessions::doGetNext() { 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; |