checked sources of xorg-server 1.7.0 with static code analysis tool cppcheck

Martin Ettl ettl.martin at gmx.de
Fri Oct 2 14:10:09 PDT 2009


Hi friends,

i run cppcheck (a static code analysis tool; http://sourceforge.net/projects/cppcheck/) against the sources of xorg-server 1.7.0. I created a patch to clean up the following issues (see attachments):

../xfree86/os-support/linux/lnx_apm.c,183,Error,Resource leak: fd
../xfree86/dixmods/extmod/xf86vmode.c,123,Error,Invalid number of character ((). Can't process file.
../xfree86/dri/dri.c,1694,Error,Possible null pointer dereference: newContext - otherwise it is redundant to check if newContext is null at line 1704
../xwin/winshadgdi.c,288,Error,Deallocating a deallocated pointer: pbmih
../kdrive/sdl/sdl.c,98,Error,Memory leak: sdlDriver
../xquartz/mach-startup/bundle-main.c,304,Error,Memory leak: handoff_data
../xquartz/xpr/x-list.c,106,Error,Memory leak: b
../xnest/Keyboard.c,210,Error,Possible null pointer dereference: pDev - otherwise it is redundant to check if pDev is null at line 215
../dmx/config/dmxcompat.c,235,Error,Resource leak: str
../dmx/input/lnx-keyboard.c,426,Error,Resource leak: fd
../../xkb/ddxList.c,217,possible error,Resource leak: in
../../xkb/ddxList.c,217,Error,Resource leak: in
../../glx/glxdri.c,512,possible style,Division with signed and unsigned operators
../../glx/glxdri.c,558,possible style,Division with signed and unsigned operators
../../exa/exa_mixed.c,107,Error,Possible null pointer dereference: pPixmap - otherwise it is redundant to check if pPixmap is null at line 112
../../exa/exa_driver.c,125,Error,Possible null pointer dereference: pPixmap - otherwise it is redundant to check if pPixmap is null at line 130
../../exa/exa_classic.c,147,Error,Possible null pointer dereference: pPixmap - otherwise it is redundant to check if pPixmap is null at line 152


Best regards

Martin



-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

-- 
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: cppcheck_foundbugs.patch
Type: text/x-patch
Size: 5265 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20091002/d7832d1a/attachment.bin 


More information about the xorg-devel mailing list