On Fri, Aug 28, 2009 at 5:22 PM, Marcus Meissnermarcus@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.