CPPCheck Run for Friday August 21

Mike Kaplinskiy mike.kaplinskiy at gmail.com
Fri Aug 21 22:33:07 CDT 2009

On Fri, Aug 21, 2009 at 9:21 PM, chris ahrendt<celticht32 at yahoo.com> wrote:
> [../wine-git/dlls/msvcrt/tests/file.c:997]: (error) Resource leak: stream1
> [../wine-git/dlls/msvcrt/tests/file.c:982]: (error) Deallocating a
> deallocated pointer: stream2
> [../wine-git/dlls/msvcrt/tests/file.c:966]: (error) Resource leak: stream3
> [../wine-git/dlls/msvcrt/tests/file.c:973]: (error) Resource leak: stream4
> [../wine-git/dlls/msvcrt/tests/heap.c:424]: (error) Deallocating a
> deallocated pointer: mem
> [../wine-git/dlls/ntdll/server.c:802]: (error) Resource leak: fd
> [../wine-git/dlls/rpcrt4/tests/server.c:1189]: (all) Array index out of
> bounds

False positive. Doesn't like the FIELD_OFFSET macro for alloc.

> [../wine-git/server/handle.c:201]: (error) Memory leak: new_entries

This is probably the only one here that sticks out, but afaict, it's
not a leak. There's somewhat convoluted logic involved (if
count==table->count, we don't reallocate; if reallocation fails...the
previous pointer shouldn't be deallocated, and new_entries=NULL
anyway). Its a false positive. This seems like something it shouldn't
catch though, so might want to report this bug to cppcheck devs.

> [../wine-git/tools/fnt2bdf.c:656]: (error) Resource leak: fd
> [../wine-git/tools/fnt2fon.c:303]: (error) Memory leak: file_lens
> [../wine-git/tools/makedep.c:953]: (error) Resource leak: file
> [../wine-git/tools/widl/write_msft.c:2540]: (error) Deallocating a
> deallocated pointer: fd
> [../wine-git/tools/winedump/pe.c:1549]: (all) Memory leak: map
> Chris

Thanks for running these, keeps the code nicely in check.


More information about the wine-devel mailing list