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

Coverity analysis defect 10181: Resource leak

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.1
    • Component/s: Internal Code
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Dev Tools 2019-11-04

      Description

      Leak of memory or pointers to system resources

      Defect 10181 (STATIC_C)
      Checker RESOURCE_LEAK (subcategory none)
      File: /src/mongo/shell/linenoise.cpp
      Function InputBuffer::incrementalHistorySearch(PromptBase &, int)
      /src/mongo/shell/linenoise.cpp, line: 1935
      Storage is returned from allocation function "operator new[]".

                      activeHistoryLine = new UChar32[bufferSize];

      /src/mongo/shell/linenoise.cpp, line: 1935
      Assigning: "activeHistoryLine" = storage returned from "new linenoise_utf8::UChar32[bufferSize]".

                      activeHistoryLine = new UChar32[bufferSize];

      /src/mongo/shell/linenoise.cpp, line: 1883
      Overwriting "activeHistoryLine" in "activeHistoryLine = new linenoise_utf8::UChar32[bufferSize]" leaks the storage that "activeHistoryLine" points to.

                      activeHistoryLine = new UChar32[bufferSize];

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: