[Gluster-devel] Possible errors in your source code

Patrick Matthäi pmatthaei at debian.org
Sat Nov 13 17:30:12 UTC 2010


Hello,

I have done an automatig source code check with cppcheck 1.44 for your
source code and get the following result:

[./glusterfs-3.0.6/booster/src/booster_fstab.c:427]: (error) Memory
leak: timeostr
[./glusterfs-3.0.6/libglusterfs/src/dict.c:179]: (error) Memory leak:
newdata
[./glusterfs-3.0.6/libglusterfs/src/fd.c:464]: (error) Possible null
pointer dereference: fd - otherwise it is redundant to check if fd is
null at line 466
[./glusterfs-3.0.6/libglusterfs/src/spec.lex.c:562]: (error) Common
realloc mistake: "text" nulled but not freed upon failure
[./glusterfs-3.0.6/libglusterfs/src/statedump.c:185]: (error) Resource
leak: fp
[./glusterfs-3.0.6/libglusterfs/src/y.tab.c:2096]: (error) Common
realloc mistake: "cmd" nulled but not freed upon failure
[./glusterfs-3.0.6/libglusterfs/src/y.tab.c:2101]: (error) Common
realloc mistake: "result" nulled but not freed upon failure
[./glusterfs-3.0.6/libglusterfs/src/y.tab.c:1743]: (error) Memory leak: node
[./glusterfs-3.0.6/libglusterfs/src/y.tab.c:2067]: (error) Memory leak: cmd
[./glusterfs-3.0.6/xlators/protocol/client/src/client-protocol.c:3495]:
(error) Possible null pointer dereference: iobuf - otherwise it is
redundant to check if iobuf is null at line 3566
[./glusterfs-3.0.6/xlators/protocol/server/src/server-protocol.c:324]:
(error) Possible null pointer dereference: state - otherwise it is
redundant to check if state is null at line 344
[./glusterfs-3.0.6/xlators/protocol/server/src/server-protocol.c:5927]:
(error) Possible null pointer dereference: xl
[./glusterfs-3.0.6/xlators/protocol/server/src/server-protocol.c:5941]:
(error) Possible null pointer dereference: xl
[./glusterfs-3.0.6/xlators/storage/posix/src/posix.c:1072]: (error)
Common realloc mistake: "entry_path" nulled but not freed upon failure


Please note, that I did not verify, if the errors are a false positive,
or not. Please check it, thanks!

-- 
/*
Mit freundlichem Gruß / With kind regards,
 Patrick Matthäi
 GNU/Linux Debian Developer

E-Mail: pmatthaei at debian.org
        patrick at linux-dev.org

Comment:
Always if we think we are right,
we were maybe wrong.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20101113/a1b56695/attachment-0003.sig>


More information about the Gluster-devel mailing list