Coverity analysis defect 121877: Copy without assign

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Sharding EMEA 2022-04-04
    • 136
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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/s/operation_sharding_state.h:183: COPY_WITHOUT_ASSIGN 121877 Class "mongo::OperationShardingState::ShardVersionTracker" has a user-written copy constructor "mongo::OperationShardingState::ShardVersionTracker::ShardVersionTracker(mongo::OperationShardingState::ShardVersionTracker const &) =delete" but no corresponding user-written assignment operator.
      /src/mongo/db/s/operation_sharding_state.h:186: COPY_WITHOUT_ASSIGN 121877 User-written copy constructor.

            Assignee:
            Kaloian Manassiev
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: