cppcheck run against 1.27

Mike Kaplinskiy mike.kaplinskiy at gmail.com
Sat Aug 8 17:53:18 CDT 2009


On Sat, Aug 8, 2009 at 4:56 AM, Marcus Meissner<marcus at jet.franken.de> wrote:
> On Fri, Aug 07, 2009 at 06:36:36PM -0700, chris ahrendt wrote:
>>
>> [../wine-git/dlls/ntdll/server.c:802]: (error) Resource leak: fd
>
> I do not fully understand the code (keep fd open to have to lock
> existing?), but it is in a fatal exit path.
>

It's a check to see if the server is running in some way (server opens
and locks a file when started, I'm guessing). Regardless, once
fatal_error is called, we exit, so this is a false positive (well
rather, its correct, but we expect the system to clean this one up).

>> [../wine-git/tools/fnt2bdf.c:219]: (error) Resource leak: fp
>> [../wine-git/tools/fnt2bdf.c:653]: (error) Resource leak: fd
>
> Fix submitted, seem necessary.
>
>> [../wine-git/tools/fnt2fon.c:304]: (error) Memory leak: file_lens
>
> Fix submitted, but program is shortlived.
>
>> [../wine-git/tools/widl/write_msft.c:2540]: (error) Deallocating a
>> deallocated pointer: fd
>
> I do not understand what it mislikes about it. I think the detection
> is wrong.

ctl2_write_chunk can close the fd if something goes wrong (and almost
all functions use it). Then we end up closing the fd twice.

>
>> [../wine-git/tools/winebuild/res16.c:187]: (error) Resource leak: fd
>
> Fix submitted. Small issue though.
>
>> [../wine-git/tools/winedump/pe.c:1549]: (error) Memory leak: map
>
> Fix submitted. Small issue though.
>
> Ciao, Marcus
>
>
>

Mike.



More information about the wine-devel mailing list