On Sat, Oct 03, 2009 at 01:56:29PM +0200, Martin Ettl wrote:
> here is another issue (spotted out by cppcheck, a static code analysis tool).
> 
> It prints the following warning:
> 
> ../xfree86/common/xf86Configure.c,266,possible error,Resource leak: fd
> 
> Take a look into file xf86Configure.c at line 266:
> 
> ...
>       fd = open("/dev/wsmouse", 0);
>       if (fd > 0) {
>           DFLT_MOUSE_DEV = "/dev/wsmouse";
>           DFLT_MOUSE_PROTO = "wsmouse";
>           close(fd);
>       } else {
>           ErrorF("cannot open /dev/wsmouse\n");
>       }
> ...
> 
> As you can see, the if()-statement is wrong because open returns the 
> filepointer or, in case of an error -1 !! See the attached patch that 
> corrects that issue.

Acked-by: Daniel Stone <[email protected]>

I've merged both of these fixes into ~daniels/xserver.

Attachment: pgpieSuEhyLK2.pgp
Description: PGP signature

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to