[SERVER-63060] Coverity analysis defect 121404: Copy without assign Created: 27/Jan/22  Updated: 29/Oct/23  Resolved: 12/Feb/22

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

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

Attachments: PNG File Screen Shot 2022-01-27 at 4.53.57 PM.png    
Issue Links:
Duplicate
is duplicated by SERVER-63061 Coverity analysis defect 121404: Copy... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2022-02-21
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/tenant_namespace.h:45: COPY_WITHOUT_ASSIGN 121404 Class "mongo::TenantNamespace" has a user-written copy constructor "mongo::TenantNamespace::TenantNamespace(mongo::TenantNamespace const &)" but no corresponding user-written assignment operator.
/src/mongo/db/tenant_namespace.h:47: COPY_WITHOUT_ASSIGN 121404 User-written copy constructor.



 Comments   
Comment by Githook User [ 12/Feb/22 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-63060 Coverity analysis defect 121404: Copy without assign
Branch: master
https://github.com/mongodb/mongo/commit/02fb1548e140b00734834bd3b624f31826ff3c74

Comment by Kyle Suarez [ 27/Jan/22 ]

Looks related to SERVER-61983 and SERVER-62441.

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