[cppcheck] resource leaks xorg-server-1.7.0/hw/kdrive/linux/bus.c

Martin Ettl ettl.martin at gmx.de
Sat Oct 3 05:14:04 PDT 2009

Hi friends,

here is another issue (spotted out by cppcheck, a static code analysis tool).

It prints the following warning:

../kdrive/linux/bus.c,73,Error,Resource leak: fd
../kdrive/linux/bus.c,112,Error,Resource leak: fd

The open commad returns the filepointer or in case of an error -1 !! See the attached patch that corrects that issues.

Best regards


Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrong_usage_of_open.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20091003/88f91d4d/attachment.bin 

More information about the xorg-devel mailing list