Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-63060

Coverity analysis defect 121404: Copy without assign

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.3.0
    • None
    • None
    • Fully Compatible
    • ALL
    • Server Serverless 2022-02-21

    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.

      Attachments

        Activity

          People

            sophia.tan@mongodb.com Sophia Tan
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: