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

Coverity analysis defect 115965: Copy without assign (RadixStore)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
    • Operating System:
      ALL

      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/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:76: COPY_WITHOUT_ASSIGN 115965 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> > >" 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> > >::RadixStore(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> > > const &)" but no corresponding user-written assignment operator.
      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:478: COPY_WITHOUT_ASSIGN 115965 User-written copy constructor.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-execution Backlog - Execution Team
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: