[SERVER-52671] Coverity analysis defect 116611: Copy without assign Created: 06/Nov/20  Updated: 29/Oct/23  Resolved: 04/Dec/20

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: coverity, servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service arch 2020-12-14
Participants:

 Description   

Copy without assign

This class has a user-defined copy constructor but no user-defined assignment operator. If the copy constructor is necessary to manage owned resources then a corresponding assignment operator is usually required. If an object of this type is assigned memory leaks and/or use-after-free errors may occur. Note that a compiler-generated assignment operator will perform only a bit-wise copy for any fields that do not have their own assignment operators defined. Class has user-written copy constructor but no user-written assignment operator
/src/mongo/db/request_execution_context.h:54: COPY_WITHOUT_ASSIGN 116611 Class "mongo::RequestExecutionContext" has a user-written copy constructor "mongo::RequestExecutionContext::RequestExecutionContext(mongo::RequestExecutionContext const &) =delete" but no corresponding user-written assignment operator.
/src/mongo/db/request_execution_context.h:57: COPY_WITHOUT_ASSIGN 116611 User-written copy constructor.



 Comments   
Comment by Githook User [ 04/Dec/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-52671 provide copy/move assignment ops to match copy/move constructors
Branch: master
https://github.com/mongodb/mongo/commit/07582b2f254385c5c86cdc70160e18718e6f5306

Comment by Billy Donahue [ 03/Dec/20 ]

CR https://mongodbcr.appspot.com/724860003/

Generated at Thu Feb 08 05:28:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.