Weekly cppcheck run against Aug 27 Git Tree

Mike Kaplinskiy mike.kaplinskiy at gmail.com
Fri Aug 28 16:30:37 CDT 2009


On Fri, Aug 28, 2009 at 5:22 PM, Marcus Meissner<marcus at jet.franken.de> wrote:
> On Fri, Aug 28, 2009 at 02:16:40PM -0700, chris ahrendt wrote:
>> Ok CPPCheck guys have repired the false positive but now get this:
>>
>> $ ./cppcheck -q -a ../wine/wine/dlls/wineoss.drv/mixer.c
>> ../wine/wine/dlls/wineoss.drv/mixer.c:576: (error) Resource leak: mixer
>> ../wine/wine/dlls/wineoss.drv/mixer.c:600: (error) Resource leak: mixer
>> ../wine/wine/dlls/wineoss.drv/mixer.c:1454: (error) Resource leak: mixer
>>
>> can someone tell me if these are false positives as well?
>
>
>    if ((mixer = open(mix->dev_name, O_RDWR)) >= 0) {
>        if (ioctl(mixer, SOUND_MIXER_READ_RECSRC, &mask) >= 0) {
>            ret = TRUE;
>        } else {
>            ERR("ioctl(%s, SOUND_MIXER_READ_RECSRC) failed (%s)\n",
>                mix->dev_name, strerror(errno));
>        }
>        close(mixer);
>    }
>
> The code looks good to me.
>
> Ciao, Marcus
>
>
>

Yep this looks fine. For experimentation sake, see if cppcheck prefers
!= -1 as opposed to >= 0. Also a bug that they should probably know
about.

Mike.



More information about the wine-devel mailing list