Title: Potential memory leak reported by cppcheck
While playing around with static code analysis with cppcheck, I ran into
the error "[modules/sqlite3_omit.c:22845]: (error) Memory leak: p". I can't
tell whether it's significant or not, but I figured I'd report it anyway.
The line number for the report is 22845 in version 3.27.2
The line number for the report is 23065 in version 3.30.1
On 12/1/19, David Brouwer <[hidden email]> wrote:
> While playing around with static code analysis with cppcheck, I ran into
> the error "[modules/sqlite3_omit.c:22845]: (error) Memory leak: p". I can't
> tell whether it's significant or not, but I figured I'd report it anyway.
Thanks for taking the time to report it. But this is not a helpful bug report.
(1) Static analyzers are notorious for giving false-positive
indications in SQLite. Furthermore, SQLite is very intensely tested
for memory leaks, and memory leaks are rare. The chance of a static
analyzer finding a memory leak, even if one were in the code, is very
small. Given the high proportion of false-positives coming from
static analyzers, one can safely disbelieve any reports of memory
leaks that lack corroborating evidence.
(2) The line number listed is the "return" from an internal SQLite
routine that is a wrapper around malloc(). Telling us that the
"return" from malloc() is a memory leak is not helpful information,
even if it were true.