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

native_sasl_client_session.cpp uses 'new' to create pointers

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Server Security

    Description

      native_sasl_client_session.cpp has a number of function calls like this:

      _saslConversation.reset(new SaslPLAINClientConversation(this));
      

      'new' is considered bad form, because it creates objects which for a split second can leak if an exception is thrown. Instead, the code in this file should use make_unique. For example:

      _saslConversation = std::make_unique<SaslPLAINClientConversation>(this);
      

      Attachments

        Activity

          People

            backlog-server-security Backlog - Security Team
            spencer.jackson@mongodb.com Spencer Jackson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: