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

Coverity analysis defect 10181: Resource leak

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.1
    • None
    • Internal Code
    • Fully Compatible
    • ALL
    • 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

            billy.donahue@mongodb.com Billy Donahue
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: