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-10-05 14:00:26 +0000 |
commit | 2098f60658d9d8d6dc7560b7a8047ac6416a1481 (patch) | |
tree | e7603fce0cbfbbf104a3ea4e9d2d96fc8187f6d9 | |
parent | 30c8bff0bf35dce45b8d18d35bad0095cd0959e1 (diff) | |
download | mongo-2098f60658d9d8d6dc7560b7a8047ac6416a1481.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.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 53beab31a77..a384591adcf 100644 --- a/src/mongo/db/pipeline/document_source_list_local_sessions.cpp +++ b/src/mongo/db/pipeline/document_source_list_local_sessions.cpp @@ -48,9 +48,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; |