[SERVER-68049] Coverity analysis defect 122540: Copy without assign Created: 14/Jul/22  Updated: 26/Jul/22  Resolved: 26/Jul/22

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

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Alya Berciu
Resolution: Duplicate Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-07-14 at 9.35.32 AM.png    
Issue Links:
Depends
depends on SERVER-67497 Refactor the hist-ce prototype to sep... Closed
Problem/Incident
is caused by SERVER-66957 Histogram-based CE for SargableNodes ... Closed
is caused by SERVER-67497 Refactor the hist-ce prototype to sep... Closed
Sprint: QO 2022-08-08
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/query/ce/array_histogram.h:36: COPY_WITHOUT_ASSIGN 122540 Class "mongo::ce::ArrayHistogram" has a user-written copy constructor "mongo::ce::ArrayHistogram::ArrayHistogram(mongo::ce::ArrayHistogram const &) =delete" but no corresponding user-written assignment operator.
/src/mongo/db/query/ce/array_histogram.h:52: COPY_WITHOUT_ASSIGN 122540 User-written copy constructor.



 Comments   
Comment by Alya Berciu [ 26/Jul/22 ]

Closing as a duplicate of SERVER-67497, which has been merged.

Comment by Alya Berciu [ 25/Jul/22 ]

This will be fixed as part of SERVER-67497. I'll close this once that's merged since I don't know if this would be regenerated if I close it as a dupe.

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