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

Coverity analysis defect 115974: Copy without assign (Node)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Execution Team 2021-06-14, Execution Team 2021-07-12, Execution Team 2021-07-26, Execution Team 2021-08-09

      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/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:77: COPY_WITHOUT_ASSIGN 115974 Class "mongo::ephemeral_for_test::RadixStore<std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node" has a user-written copy constructor "mongo::ephemeral_for_test::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node::Node(mongo::ephemeral_for_test::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node const &)" but no corresponding user-written assignment operator.
      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:837: COPY_WITHOUT_ASSIGN 115974 User-written copy constructor.

            Assignee:
            henrik.edin@mongodb.com Henrik Edin
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: