Details
-
Bug
-
Resolution: Out of scope
-
P4: Low
-
None
-
5.0.0
-
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.