[SERVER-69208] Coverity analysis defect 123323: Using a moved object Created: 26/Aug/22  Updated: 29/Oct/23  Resolved: 04/Oct/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Paolo Polato
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding EMEA 2022-10-03, Sharding EMEA 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.cpp:936: USE_AFTER_MOVE 123323 "shardVersion" is moved (indicated by "std::move(shardVersion)").
/src/mongo/s/chunk_manager.cpp:939: USE_AFTER_MOVE 123323 "shardVersion" is used after it has been already moved.



 Comments   
Comment by Githook User [ 04/Oct/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-69208 Fix Coverity warning in ChunkManager
Branch: master
https://github.com/mongodb/mongo/commit/7f9de164226d7d39357848ae52de110a39dc3ac3

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