DebCheck QA: Common realloc mistake: nulled but not freed upon failure
|Reported by:||hamish||Owned by:|
Debian's run of the Cpp check tool automatically found a number of C-code errors (or potential errors) which need to be reviewed by hand. See grass-dev ML thread of 13 Jan 2011.
about: Cppcheck is a command-line tool that tries to detect bugs that your C/C++ compiler doesn't see. It is versatile, and can check non-standard code including various compiler extensions, inline assembly code, etc. Its internal preprocessor can handle includes, macros, and several preprocessor commands. While Cppcheck is highly configurable, you can start using it just by giving it a path to the source code.
the list of probably-bugs in the 6.4.0 C/C++ code:
CLI analysis program (not Debian specific):
I have split those 154 hits into 16 classes, and will report each class in an individual bug report.
Run against releasebranch6_4 r42329 (including all patches up to, but not beyond, 6.4.0-final)
This bug report is for: Common realloc mistake: nulled but not freed upon failure
- ./raster/r.terraflow/unionFind.h:127 [error] - Common realloc mistake: "parent" nulled but not freed upon failure
- ./raster/r.terraflow/unionFind.h:131 [error] - Common realloc mistake: "rank" nulled but not freed upon failure
- ./vector/v.label.sa/labels.c:131 [error] - Common realloc mistake: "labels" nulled but not freed upon failure
Modules: r.terraflow, v.label.sa