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

Coverity analysis defect 111241: Resource leak

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Networking
    • Labels:
    • Operating System:
      ALL
    • Sprint:
      Security 2019-02-25

      Description

      Leak of memory or pointers to system resources

      Defect 111241 (STATIC_C)
      Checker RESOURCE_LEAK (subcategory none)
      File: /src/mongo/util/net/hostname_canonicalization.cpp
      Function mongo::getHostFQDNs(std::basic_string<char, std::char_traits<char>, std::allocator<char>>, mongo::HostnameCanonicalizationMode)
      /src/mongo/util/net/hostname_canonicalization.cpp, line: 92
      "shim_getaddrinfo" allocates memory that is stored into "info". (The function pointer resolves to "getaddrinfo".)

              if ((err = shim_getaddrinfo(nativeHostName.c_str(), nullptr, &hints, &info)) != 0) {

      /src/mongo/util/net/hostname_canonicalization.cpp, line: 101
      Variable "info" going out of scope leaks the storage it points to.

                  return results;

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: