[SERVER-69209] Coverity analysis defect 123103: Using a moved object Created: 26/Aug/22  Updated: 27/Oct/23  Resolved: 03/Oct/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Kyle Suarez
Resolution: Gone away Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: QE 2022-10-17
Participants:

 Description   

Using a moved object

Using a moved object may lead to an unexpected/undefined behavior. An object is used after it's moved.
/src/mongo/s/chunk_manager_targeter.cpp:623: USE_AFTER_MOVE 123103 "shardId" is moved (indicated by "std::move(shardId)").
/src/mongo/s/chunk_manager_targeter.cpp:623: USE_AFTER_MOVE 123103 "shardId" is used after it has been already moved.



 Comments   
Comment by Kyle Suarez [ 03/Oct/22 ]

The offending code has been purged, and I verified that ChunkManagerTargeter::targetAllShards() no longer has a use-after-move.

Generated at Thu Feb 08 06:12:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.