Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-25287

[cppcheck] resource leaks in btree

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 5.0.0
    • (Inactive) JsonDB
    • None
    • qtjsondb 7eaf00aa901455e82d0c36df7aa5908433572e17

    Description

      cppcheck detects two leaks which can occur in ./src/3rdparty/btree/src/btree.cpp .

      The error report is:

      [./src/3rdparty/btree/src/btree.cpp:4102]: (error) Resource leak: fd
      [./src/3rdparty/btree/src/btree.cpp:4144]: (error) Memory leak: p
      

      Both leaks are in the btree_dump_page_from_file function.
      Firstly, a file is opened and never closed, leaking a file descriptor.
      Secondly, a calloc() is performed and the memory is not freed if an error occurs reading from the file.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            rmcgover Rohan McGovern (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes