[PC-BSD Dev] cppcheck and co.

Kris Moore kris at pcbsd.org
Tue Feb 28 10:40:38 PST 2012


On 02/25/2012 11:37, Yuri Momotiuk wrote:
> I have just run cppcheck on src-qt4 dir and got:
>
> [pc-netmanager/src/NetworkManager/networkman.cpp:532]: (error)
> Mismatching allocation and deallocation: file
> [pc-netmanager/src/ethernetconfig/ethernetconfig.cpp:273]: (error)
> Mismatching allocation and deallocation: file
> [pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp:687]: (error)
> Mismatching allocation and deallocation: file
> [pc-pbigui/pbi.cpp:361]: (error) Mismatching allocation and
> deallocation: file
> [pc-pfmanager/config/interfaces.cpp:53]: (error) Resource leak: file
> [pc-sounddetect/sound_detect.c:150]: (error) Resource leak: inF
> [pc-sysmanager/cvsupprogress.cpp:265]: (error) Uninitialized variable:
> nullBox
>
> Also I saw some potential bugs in code for config files analyze:
> For example line from Utils.cpp (libpcbsd)
>
> /if ( line.indexOf("#", 0) == 0 || line.indexOf(Key, 0) == -1 ||
> line.indexOf(Key, 0) > 0)/
>
> should be like this:
>
> /if ( line.*_trimmed()._*indexOf("#", 0) == 0 || line.indexOf(Key, 0)
> == -1 || line.indexOf(Key, 0) > 0)/
>
> Otherwise code can not catch comment if there is space between "#" in
> line. Please recheck related code.
>
> -- 
> Best regards, Yuri Momotyuk
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/dev

Thanks, got all those fixed in SVN :)

-- 
Kris Moore
PC-BSD Software
iXsystems

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pcbsd.org/pipermail/dev/attachments/20120228/35bdcacc/attachment.html>


More information about the Dev mailing list