https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58237

--- Comment #8 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to David Binderman from comment #6)
> I tried out recent cppcheck on recent gcc trunk and found these resource
> leaks:
> 
> trunk/libvtv/scripts/sum-vtv-counts.c:94:4: error: Resource leak: fp_in
> [resourceLeak]
> trunk/libvtv/scripts/sum-vtv-counts.c:105:7: error: Resource leak: fp_in
> [resourceLeak]
> trunk/zlib/contrib/minizip/mztools.c:290:3: error: Resource leak: fpOutCD
> [resourceLeak]
> 
> The first two are false positives, cppcheck doesn't notice the leak is
> in main.

My analyzer does the right thing here: it doesn't report the leaks; if I rename
"main" to "not_main" it does report them.

> Last one has a missing sanity check for fpOutCD != NULL, but since
> it is in a /contrib/ directory, it won't get fixed here.

Unfortunately the analyzer doesn't report this one; I've filed it for myself as
PR analyzer/93032.

> Does the recent patch find the same or different resource leaks on gcc trunk
> ?

I'll test that next.

Thanks!

Reply via email to