[torquedev] cppcheck found faults in linux/mom_mach.c ?

Christopher Samuel samuel at unimelb.edu.au
Mon Mar 14 00:09:24 MDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just playing with cppcheck and it spots:

[trunk/src/resmom/linux/mom_mach.c:529]: (error) Resource leak: fp

Looking at the code it appears there are a number of
places where the function returns without closing the
file descriptor it opened.

Am I reading that right ?

It complains in the same way about 2.4-fixes, 2.5-fixes
and 3.0-fixes code too.

It also complains about:

[trunk/src/resmom/linux/mom_mach.c:3967]: (error) Uninitialized
variable: tmpBuf

I'm less sure about this one, it might just be getting
confused about the weird way that tmpBuf and Bstr get
manipulated (I know I am!).

cheers,
Chris
- -- 
    Christopher Samuel - Senior Systems Administrator
 VLSCI - Victorian Life Sciences Computation Initiative
 Email: samuel at unimelb.edu.au Phone: +61 (0)3 903 55545
         http://www.vlsci.unimelb.edu.au/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk19sRQACgkQO2KABBYQAh/WJQCfcAvvXydOt6BUVFO4C4IhzvH3
tYkAn1pzEfgg4646fHdTWDofGTEFs0f6
=LHXh
-----END PGP SIGNATURE-----


More information about the torquedev mailing list