Bug report: cppcheck memory leak

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug report: cppcheck memory leak

David Brouwer
Dear,

Title: Potential memory leak reported by cppcheck
Version: 3.27.2

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

Kind regards,
David Brouwer
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Bug report: cppcheck memory leak

Richard Hipp-3
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.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Bug report: cppcheck memory leak

Simon Slavin-3
On 2 Dec 2019, at 1:16am, Richard Hipp <[hidden email]> wrote:

> Telling us that the
> "return" from malloc() is a memory leak is not helpful information,
> even if it were true.

Oh, someone needs to write a story about a manager who doesn't understand computers but relies on test suites, and programmers trying to convince them that there are good reasons to fail tests.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users