-------- Original-Nachricht -------- > Datum: Mon, 22 Mar 2010 23:55:40 +0000 (UTC) > Von: Csaba Henk <csaba@xxxxxxxxxxx> > An: gluster-devel@xxxxxxxxxx > Betreff: Re: Possible leaks and so on > Hi Patrick, > > On 2010-03-22, Vijay Bellur <vijay@xxxxxxxxxxx> wrote: > > Some of the issues reported are valid and they will be addressed through > > this bug: > > > > http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=748 > > We have already run cppchek on the source: > > http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=420 > > However, it didn't cough up those code points you mention -- see eg.: > > $ cppcheck --force build/libglusterfs/src/y.tab.c > Checking build/libglusterfs/src/y.tab.c... > Checking build/libglusterfs/src/y.tab.c: YYENABLE_NLS... > Checking build/libglusterfs/src/y.tab.c: YYENABLE_NLS;ENABLE_NLS... > Checking build/libglusterfs/src/y.tab.c: YYLEX_PARAM... > Checking build/libglusterfs/src/y.tab.c: YYLLOC_DEFAULT... > Checking build/libglusterfs/src/y.tab.c: YYLTYPE_IS_TRIVIAL... > Checking build/libglusterfs/src/y.tab.c: YYPARSE_PARAM... > Checking build/libglusterfs/src/y.tab.c: YYPRINT... > Checking build/libglusterfs/src/y.tab.c: YYSTACK_RELOCATE... > Checking build/libglusterfs/src/y.tab.c: YYTYPE_INT16... > Checking build/libglusterfs/src/y.tab.c: YYTYPE_INT8... > Checking build/libglusterfs/src/y.tab.c: YYTYPE_UINT16... > Checking build/libglusterfs/src/y.tab.c: YYTYPE_UINT8... > Checking build/libglusterfs/src/y.tab.c: YY_... > Checking build/libglusterfs/src/y.tab.c: YY_LOCATION_PRINT... > Checking build/libglusterfs/src/y.tab.c: > _GNU_SOURCE;_STRING_H;__GLIBC__... > Checking build/libglusterfs/src/y.tab.c: _STRING_H;__GLIBC__... > Checking build/libglusterfs/src/y.tab.c: __SIZE_TYPE__... > Checking build/libglusterfs/src/y.tab.c: lint... > Checking build/libglusterfs/src/y.tab.c: short... > Checking build/libglusterfs/src/y.tab.c: size_t... > Checking build/libglusterfs/src/y.tab.c: yyoverflow... > Checking build/libglusterfs/src/y.tab.c: yytnamerr... > > So, besides saying thanks for pointing these out, may I ask what did you > do differently? > > Ehhhrm, to prevent you in telling me "RTFM", I looked at the options so > this time I also tried with > > $ cppcheck -a --force build/libglusterfs/src/y.tab.c > > still I get only this one: > > ./libglusterfs/src/y.tab.c:1743]: (error) Memory leak: node > > but not this one: > > [./libglusterfs/src/y.tab.c:2067]: (error) Memory leak: cmd > > I'm confused. > You are probably using an old version of cpp-check. Using 1.4.2 gives following result when checking against libglusterfs/src/y.tab.c: ----------------------------- theia glusterfs-3.0.3 # cppcheck --enable=all --force --quiet --unused-functions ./libglusterfs/src/y.tab.c [./libglusterfs/src/y.tab.c:2049]: (style) Variable 'backtick_column' is assigned a value that is never used [./libglusterfs/src/y.tab.c:2049]: (style) Variable 'backtick_line' is assigned a value that is never used [./libglusterfs/src/y.tab.c:1743]: (possible error) Memory leak: node [./libglusterfs/src/y.tab.c:2067]: (possible error) Memory leak: cmd [./libglusterfs/src/y.tab.c:183] -> [./libglusterfs/src/y.tab.c:180]: (style) Typedef 'yytype_int8' hides typedef with same name [./libglusterfs/src/y.tab.c:1]: (style) The function 'yywrap' is never used theia glusterfs-3.0.3 # ----------------------------- Checking the whole 3.0.3 tree results in: ----------------------------- theia glusterfs-3.0.3 # cppcheck --enable=all --force --quiet --unused-functions . [./booster/src/booster-fd.c:243]: (style) The scope of the variable error can be reduced [./booster/src/booster.c:398]: (style) The scope of the variable mode can be reduced [./booster/src/booster.c:401]: (style) The scope of the variable ap can be reduced [./booster/src/booster.c:541]: (style) The scope of the variable mode can be reduced [./booster/src/booster.c:542]: (style) The scope of the variable ap can be reduced [./booster/src/booster.c:562]: (style) The scope of the variable mode can be reduced [./booster/src/booster.c:563]: (style) The scope of the variable ap can be reduced [./booster/src/booster.c:997]: (style) The scope of the variable ret can be reduced [./booster/src/booster.c:217]: (style) struct or union member 'booster_mount::st_dev' is never used [./booster/src/booster.c:218]: (style) struct or union member 'booster_mount::handle' is never used [./booster/src/booster.c:219]: (style) struct or union member 'booster_mount::device_list' is never used [./booster/src/booster.c:376]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./booster/src/booster.c:384]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./booster/src/booster_fstab.c:324]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./booster/src/booster_fstab.c:327]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./booster/src/booster_fstab.c:330]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./booster/src/booster_fstab.c:333]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./contrib/fuse-lib/mount.c:594]: (style) The scope of the variable rv can be reduced [./glusterfsd/src/glusterfsd.c:175]: (style) The scope of the variable ret can be reduced [./glusterfsd/src/glusterfsd.c:1043]: (style) The scope of the variable port can be reduced [./libglusterfs/src/common-utils.c:296]: (style) Variable 'ret' is assigned a value that is never used [./libglusterfs/src/common-utils.c:394]: (style) Variable 'ret' is assigned a value that is never used [./libglusterfs/src/common-utils.c:596]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./libglusterfs/src/compat.c:133]: (style) Variable 'ret' is assigned a value that is never used [./libglusterfs/src/compat.c:193]: (style) Variable 'ret' is assigned a value that is never used [./libglusterfs/src/compat.c:135]: (style) The scope of the variable ret can be reduced [./libglusterfs/src/compat.c:195]: (style) The scope of the variable ret can be reduced [./libglusterfs/src/compat.c:223]: (style) The scope of the variable newfd can be reduced [./libglusterfs/src/compat.c:277]: (style) The scope of the variable newfd can be reduced [./libglusterfs/src/dict.c:216]: (style) The scope of the variable ret can be reduced [./libglusterfs/src/dict.c:2480]: (style) The scope of the variable len can be reduced [./libglusterfs/src/dict.c:83]: (error) Memory leak: dict [./libglusterfs/src/dict.c:179]: (error) Memory leak: newdata [./libglusterfs/src/dict.c:251]: (possible error) Memory leak: pair [./libglusterfs/src/event.c:385]: (style) The scope of the variable i can be reduced [./libglusterfs/src/event.c:394]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./libglusterfs/src/event.c:523]: (style) The scope of the variable idx can be reduced [./libglusterfs/src/event.c:618]: (style) The scope of the variable idx can be reduced [./libglusterfs/src/event.c:623]: (style) The scope of the variable lastidx can be reduced [./libglusterfs/src/event.c:694]: (style) The scope of the variable idx can be reduced [./libglusterfs/src/event.c:834]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./libglusterfs/src/fd.c:464]: (error) Possible null pointer dereference: fd - otherwise it is redundant to check if fd is null at line 466 [./libglusterfs/src/fd.c:183]: (style) The scope of the variable i can be reduced [./libglusterfs/src/fd.c:216]: (style) The scope of the variable error can be reduced [./libglusterfs/src/fd.c:217]: (style) The scope of the variable alloc_attempts can be reduced [./libglusterfs/src/globals.c:99]: (style) The scope of the variable ret can be reduced [./libglusterfs/src/inode.c:901]: (style) The scope of the variable i can be reduced [./libglusterfs/src/inode.c:901]: (style) The scope of the variable size can be reduced [./libglusterfs/src/inode.c:903]: (style) The scope of the variable len can be reduced [./libglusterfs/src/inode.c:1267]: (style) The scope of the variable index can be reduced [./libglusterfs/src/inode.c:1155]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./libglusterfs/src/iobuf.c:576]: (style) The scope of the variable i can be reduced [./libglusterfs/src/iobuf.c:624]: (style) The scope of the variable i can be reduced [./libglusterfs/src/logging.c:427]: (style) The scope of the variable ap can be reduced [./libglusterfs/src/logging.c:435]: (style) The scope of the variable len can be reduced [./libglusterfs/src/spec.lex.c:390]: (style) struct or union member 'yy_trans_info::yy_verify' is never used [./libglusterfs/src/spec.lex.c:391]: (style) struct or union member 'yy_trans_info::yy_nxt' is never used [./libglusterfs/src/spec.lex.c:869]: (style) Unreachable code below a 'return' [./libglusterfs/src/spec.lex.c:874]: (style) Unreachable code below a 'return' [./libglusterfs/src/spec.lex.c:879]: (style) Unreachable code below a 'return' [./libglusterfs/src/spec.lex.c:884]: (style) Unreachable code below a 'return' [./libglusterfs/src/spec.lex.c:889]: (style) Unreachable code below a 'return' [./libglusterfs/src/statedump.c:75]: (style) Variable 'ret' is assigned a value that is never used [./libglusterfs/src/statedump.c:96]: (style) Variable 'ret' is assigned a value that is never used [./libglusterfs/src/y.tab.c:2049]: (style) Variable 'backtick_column' is assigned a value that is never used [./libglusterfs/src/y.tab.c:2049]: (style) Variable 'backtick_line' is assigned a value that is never used [./libglusterfs/src/y.tab.c:1743]: (possible error) Memory leak: node [./libglusterfs/src/y.tab.c:2067]: (possible error) Memory leak: cmd [./libglusterfs/src/y.tab.c:183] -> [./libglusterfs/src/y.tab.c:180]: (style) Typedef 'yytype_int8' hides typedef with same name [./libglusterfsclient/src/libglusterfsclient-dentry.c:409]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./libglusterfsclient/src/libglusterfsclient.c:520]: (style) The scope of the variable current can be reduced [./libglusterfsclient/src/libglusterfsclient.c:606]: (style) The scope of the variable current can be reduced [./libglusterfsclient/src/libglusterfsclient.c:607]: (style) The scope of the variable prev can be reduced [./libglusterfsclient/src/libglusterfsclient.c:610]: (style) The scope of the variable timeout can be reduced [./libglusterfsclient/src/libglusterfsclient.c:2122]: (style) The scope of the variable ret can be reduced [./libglusterfsclient/src/libglusterfsclient.c:2390]: (style) The scope of the variable ret can be reduced [./libglusterfsclient/src/libglusterfsclient.c:2606]: (style) The scope of the variable copy_len can be reduced [./libglusterfsclient/src/libglusterfsclient.c:2951]: (style) The scope of the variable mode can be reduced [./libglusterfsclient/src/libglusterfsclient.c:2952]: (style) The scope of the variable ap can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3084]: (style) The scope of the variable ap can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3087]: (style) The scope of the variable mode can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3796]: (style) The scope of the variable src can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3797]: (style) The scope of the variable dst_count can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3798]: (style) The scope of the variable len can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3798]: (style) The scope of the variable src_len can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3798]: (style) The scope of the variable dst_len can be reduced [./libglusterfsclient/src/libglusterfsclient.c:3799]: (style) The scope of the variable src_offset can be reduced [./libglusterfsclient/src/libglusterfsclient.c:7087]: (style) The scope of the variable cpy_size can be reduced [./libglusterfsclient/src/libglusterfsclient.c:7578]: (style) The scope of the variable bytes can be reduced [./libglusterfsclient/src/libglusterfsclient.c:7801]: (style) The scope of the variable resulting_cwd_len can be reduced [./libglusterfsclient/src/libglusterfsclient.c:7944]: (style) The scope of the variable len can be reduced [./libglusterfsclient/src/libglusterfsclient.c:7948]: (style) The scope of the variable op_ret can be reduced [./libglusterfsclient/src/libglusterfsclient.c:1843]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./libglusterfsclient/src/libglusterfsclient.c:6791]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./scheduler/nufa/src/nufa.c:211]: (style) The scope of the variable percent can be reduced [./scheduler/random/src/random.c:132]: (style) The scope of the variable percent can be reduced [./scheduler/rr/src/rr.c:50]: (style) The scope of the variable i can be reduced [./scheduler/rr/src/rr.c:291]: (style) The scope of the variable i can be reduced [./transport/ib-verbs/src/ib-verbs.c:257]: (style) The scope of the variable len can be reduced [./transport/ib-verbs/src/ib-verbs.c:383]: (style) The scope of the variable need_append can be reduced [./transport/ib-verbs/src/ib-verbs.c:855]: (style) The scope of the variable i can be reduced [./transport/ib-verbs/src/ib-verbs.c:1557]: (style) The scope of the variable i can be reduced [./transport/ib-verbs/src/ib-verbs.c:1935]: (style) The scope of the variable ret can be reduced [./transport/socket/src/socket.c:740]: (style) The scope of the variable ret can be reduced [./transport/socket/src/socket.c:850]: (style) The scope of the variable new_sock can be reduced [./transport/socket/src/socket.c:1312]: (style) The scope of the variable need_poll_out can be reduced [./transport/socket/src/socket.c:1313]: (style) The scope of the variable need_append can be reduced [./transport/socket/src/socket.c:275]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/cluster/afr/src/afr-dir-read.c:219]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr.h:706]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr-dir-read.c:110]: (style) The scope of the variable call_count can be reduced [./xlators/cluster/afr/src/afr-dir-read.c:223]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr-dir-read.c:729]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-dir-read.c:730]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-dir-write.c:1619]: (style) Variable 'need_unwind' is assigned a value that is never used [./xlators/cluster/afr/src/afr-dir-write.c:1619]: (style) Variable 'read_child' is assigned a value that is never used [./xlators/cluster/afr/src/afr-dir-write.c:1834]: (style) Variable 'need_unwind' is assigned a value that is never used [./xlators/cluster/afr/src/afr-dir-write.c:133]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr-dir-write.c:1625]: (style) The scope of the variable need_unwind can be reduced [./xlators/cluster/afr/src/afr-dir-write.c:1840]: (style) The scope of the variable need_unwind can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:71]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:72]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:189]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:190]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:313]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:314]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:438]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:439]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:615]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:616]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:759]: (style) The scope of the variable last_tried can be reduced [./xlators/cluster/afr/src/afr-inode-read.c:760]: (style) The scope of the variable this_try can be reduced [./xlators/cluster/afr/src/afr-inode-write.c:88]: (style) Variable 'need_unwind' is assigned a value that is never used [./xlators/cluster/afr/src/afr-inode-write.c:94]: (style) The scope of the variable need_unwind can be reduced [./xlators/cluster/afr/src/afr-inode-write.c:707]: (style) The scope of the variable op_errno can be reduced [./xlators/cluster/afr/src/afr-open.c:444]: (style) Variable 'op_ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-open.c:85]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr-open.c:225]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr-open.c:406]: (style) The scope of the variable _ret can be reduced [./xlators/cluster/afr/src/afr-open.c:407]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr-self-heal-algorithm.c:258]: (style) The scope of the variable op_errno can be reduced [./xlators/cluster/afr/src/afr-self-heal-algorithm.c:743]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr-self-heal-algorithm.c:744]: (style) The scope of the variable write_needed can be reduced [./xlators/cluster/afr/src/afr-self-heal-common.c:553]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-common.c:595]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-common.c:1301]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-common.c:559]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr-self-heal-common.c:600]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr-self-heal-data.c:757]: (style) Variable 'nsources' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-data.c:904]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-entry.c:915]: (style) Variable 'op_errno' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-entry.c:1287]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-entry.c:1908]: (style) Variable 'op_errno' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-entry.c:2396]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-entry.c:925]: (style) The scope of the variable op_errno can be reduced [./xlators/cluster/afr/src/afr-self-heal-entry.c:781]: (style) Unreachable code below a 'return' [./xlators/cluster/afr/src/afr-self-heal-entry.c:1785]: (style) Unreachable code below a 'return' [./xlators/cluster/afr/src/afr-self-heal-metadata.c:658]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr-self-heal-metadata.c:439]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr-transaction.c:1081]: (style) Variable 'done' is assigned a value that is never used [./xlators/cluster/afr/src/afr-transaction.c:198]: (style) The scope of the variable _ret can be reduced [./xlators/cluster/afr/src/afr-transaction.c:199]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr-transaction.c:240]: (style) The scope of the variable _ret can be reduced [./xlators/cluster/afr/src/afr-transaction.c:270]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr-transaction.c:273]: (style) The scope of the variable _ret can be reduced [./xlators/cluster/afr/src/afr-transaction.c:1084]: (style) The scope of the variable done can be reduced [./xlators/cluster/afr/src/afr.c:1065]: (style) Variable 'op_ret' is assigned a value that is never used [./xlators/cluster/afr/src/afr.c:2406]: (style) Variable 'call_count' is assigned a value that is never used [./xlators/cluster/afr/src/afr.c:2690]: (style) Variable 'op_errno' is assigned a value that is never used [./xlators/cluster/afr/src/afr.c:66]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr.c:94]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr.c:120]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr.c:148]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr.c:174]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr.c:202]: (style) The scope of the variable ret can be reduced [./xlators/cluster/afr/src/afr.c:322]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr.c:590]: (style) The scope of the variable source can be reduced [./xlators/cluster/afr/src/afr.c:716]: (style) The scope of the variable first_up_child can be reduced [./xlators/cluster/afr/src/afr.c:836]: (style) The scope of the variable first_up_child can be reduced [./xlators/cluster/afr/src/afr.c:1068]: (style) The scope of the variable op_ret can be reduced [./xlators/cluster/afr/src/afr.c:1301]: (style) The scope of the variable i can be reduced [./xlators/cluster/afr/src/afr.c:1304]: (style) The scope of the variable _ret can be reduced [./xlators/cluster/afr/src/afr.c:1349]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht-common.c:2999]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/dht/src/dht-common.c:3051]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/dht/src/dht-common.c:91]: (style) The scope of the variable is_dir can be reduced [./xlators/cluster/dht/src/dht-common.c:209]: (style) The scope of the variable ret can be reduced [./xlators/cluster/dht/src/dht-common.c:210]: (style) The scope of the variable is_dir can be reduced [./xlators/cluster/dht/src/dht-common.c:211]: (style) The scope of the variable is_linkfile can be reduced [./xlators/cluster/dht/src/dht-common.c:377]: (style) The scope of the variable is_dir can be reduced [./xlators/cluster/dht/src/dht-common.c:383]: (style) The scope of the variable ret can be reduced [./xlators/cluster/dht/src/dht-common.c:3002]: (style) The scope of the variable ret can be reduced [./xlators/cluster/dht/src/dht-common.c:3476]: (style) The scope of the variable ret can be reduced [./xlators/cluster/dht/src/dht-diskusage.c:44]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht-diskusage.c:130]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht-diskusage.c:228]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht-hashfn.c:78]: (style) The scope of the variable namelen can be reduced [./xlators/cluster/dht/src/dht-helper.c:193]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht-layout.c:71]: (style) The scope of the variable ret can be reduced [./xlators/cluster/dht/src/dht-selfheal.c:151]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/dht/src/dht-selfheal.c:521]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/dht/src/dht-selfheal.c:155]: (style) The scope of the variable ret can be reduced [./xlators/cluster/dht/src/dht-selfheal.c:206]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht.c:207]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/dht.c:241]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/nufa.c:504]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/nufa.c:541]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/switch.c:610]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/switch.c:869]: (style) The scope of the variable i can be reduced [./xlators/cluster/dht/src/switch.c:858]: (error) Memory leak: dup_str [./xlators/cluster/ha/src/ha-helpers.c:33]: (style) The scope of the variable i can be reduced [./xlators/cluster/ha/src/ha-helpers.c:102]: (style) The scope of the variable ret can be reduced [./xlators/cluster/ha/src/ha-helpers.c:161]: (style) The scope of the variable i can be reduced [./xlators/cluster/ha/src/ha.c:1942]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/ha/src/ha.c:1776]: (style) The scope of the variable i can be reduced [./xlators/cluster/ha/src/ha.c:3098]: (style) The scope of the variable cnt can be reduced [./xlators/cluster/ha/src/ha.c:3098]: (style) The scope of the variable j can be reduced [./xlators/cluster/ha/src/ha.c:3244]: (style) The scope of the variable cnt can be reduced [./xlators/cluster/ha/src/ha.c:3591]: (style) The scope of the variable i can be reduced [./xlators/cluster/ha/src/ha.c:3690]: (style) The scope of the variable i can be reduced [./xlators/cluster/stripe/src/stripe.c:1462]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/stripe/src/stripe.c:1865]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/stripe/src/stripe.c:1463]: (style) The scope of the variable ret can be reduced [./xlators/cluster/stripe/src/stripe.c:1944]: (style) The scope of the variable ret can be reduced [./xlators/cluster/stripe/src/stripe.c:2125]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify-self-heal.c:428]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify-self-heal.c:942]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify-self-heal.c:1149]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify.c:120]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/unify/src/unify.c:1370]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/unify/src/unify.c:1569]: (style) Variable 'ret' is assigned a value that is never used [./xlators/cluster/unify/src/unify.c:124]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify.c:126]: (style) The scope of the variable ret can be reduced [./xlators/cluster/unify/src/unify.c:707]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify.c:1371]: (style) The scope of the variable ret can be reduced [./xlators/cluster/unify/src/unify.c:1570]: (style) The scope of the variable ret can be reduced [./xlators/cluster/unify/src/unify.c:1879]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify.c:1880]: (style) The scope of the variable callcnt can be reduced [./xlators/cluster/unify/src/unify.c:2043]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify.c:2044]: (style) The scope of the variable callcnt can be reduced [./xlators/cluster/unify/src/unify.c:3536]: (style) The scope of the variable index can be reduced [./xlators/cluster/unify/src/unify.c:3610]: (style) The scope of the variable idx can be reduced [./xlators/cluster/unify/src/unify.c:4282]: (style) The scope of the variable ret can be reduced [./xlators/cluster/unify/src/unify.c:4283]: (style) The scope of the variable count can be reduced [./xlators/debug/error-gen/src/error-gen.c:354]: (style) The scope of the variable rand_no can be reduced [./xlators/debug/io-stats/src/io-stats.c:436]: (style) The scope of the variable len can be reduced [./xlators/debug/io-stats/src/io-stats.c:77]: (style) struct or union member 'ios_local::wind_at' is never used [./xlators/debug/io-stats/src/io-stats.c:78]: (style) struct or union member 'ios_local::unwind_at' is never used [./xlators/debug/trace/src/trace.c:51]: (style) struct or union member 'trace_private::debug_flag' is never used [./xlators/features/filter/src/filter.c:208]: (style) The scope of the variable ret can be reduced [./xlators/features/filter/src/filter.c:501]: (style) The scope of the variable ret can be reduced [./xlators/features/filter/src/filter.c:567]: (style) The scope of the variable ret can be reduced [./xlators/features/filter/src/filter.c:743]: (style) The scope of the variable ret can be reduced [./xlators/features/filter/src/filter.c:882]: (style) The scope of the variable ret can be reduced [./xlators/features/filter/src/filter.c:936]: (style) The scope of the variable ret can be reduced [./xlators/features/locks/src/common.c:141]: (style) The scope of the variable ret can be reduced [./xlators/features/locks/src/common.c:383]: (style) The scope of the variable is_empty can be reduced [./xlators/features/path-convertor/src/path.c:59]: (style) The scope of the variable i can be reduced [./xlators/features/path-convertor/src/path.c:59]: (style) The scope of the variable j can be reduced [./xlators/features/path-convertor/src/path.c:104]: (style) The scope of the variable i can be reduced [./xlators/features/path-convertor/src/path.c:104]: (style) The scope of the variable j can be reduced [./xlators/features/path-convertor/src/path.c:41]: (style) struct or union member 'path_private::this_len' is never used [./xlators/features/path-convertor/src/path.c:44]: (style) struct or union member 'path_private::this' is never used [./xlators/features/quota/src/quota.c:557]: (style) Variable 'ret' is assigned a value that is never used [./xlators/features/quota/src/quota.c:615]: (style) Variable 'ret' is assigned a value that is never used [./xlators/features/quota/src/quota.c:165]: (style) The scope of the variable space_freed can be reduced [./xlators/features/quota/src/quota.c:196]: (style) The scope of the variable space_freed can be reduced [./xlators/features/quota/src/quota.c:231]: (style) The scope of the variable space_used can be reduced [./xlators/features/quota/src/quota.c:289]: (style) The scope of the variable space_used can be reduced [./xlators/features/quota/src/quota.c:348]: (style) The scope of the variable space_freed can be reduced [./xlators/features/quota/src/quota.c:426]: (style) The scope of the variable space_freed can be reduced [./xlators/features/quota/src/quota.c:501]: (style) The scope of the variable space_used can be reduced [./xlators/features/quota/src/quota.c:559]: (style) The scope of the variable ret can be reduced [./xlators/features/quota/src/quota.c:561]: (style) The scope of the variable space_used can be reduced [./xlators/features/quota/src/quota.c:616]: (style) The scope of the variable ret can be reduced [./xlators/features/quota/src/quota.c:670]: (style) The scope of the variable iovlen can be reduced [./xlators/features/quota/src/quota.c:708]: (style) The scope of the variable i can be reduced [./xlators/features/quota/src/quota.c:41]: (style) struct or union member 'quota_local::inode' is never used [./xlators/features/trash/src/trash.c:395]: (style) The scope of the variable count can be reduced [./xlators/features/trash/src/trash.c:1413]: (style) The scope of the variable ret can be reduced [./xlators/mount/fuse/src/fuse-bridge.c:2485]: (style) The scope of the variable fd can be reduced [./xlators/mount/fuse/src/fuse-bridge.c:2487]: (style) The scope of the variable len can be reduced [./xlators/performance/io-cache/src/io-cache.c:184]: (style) The scope of the variable cache_still_valid can be reduced [./xlators/performance/io-cache/src/io-cache.c:461]: (style) The scope of the variable weight can be reduced [./xlators/performance/io-cache/src/io-cache.c:553]: (style) The scope of the variable weight can be reduced [./xlators/performance/io-cache/src/io-cache.c:1297]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/performance/io-cache/src/io-cache.c:1301]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/performance/io-cache/src/page.c:333]: (style) Variable 'payload_size' is assigned a value that is never used [./xlators/performance/io-cache/src/page.c:555]: (style) The scope of the variable src_offset can be reduced [./xlators/performance/io-cache/src/page.c:556]: (style) The scope of the variable dst_offset can be reduced [./xlators/performance/io-cache/src/page.c:557]: (style) The scope of the variable copy_size can be reduced [./xlators/performance/io-cache/src/page.c:560]: (style) The scope of the variable found can be reduced [./xlators/performance/io-threads/src/io-threads.c:266]: (style) The scope of the variable balstatus can be reduced [./xlators/performance/io-threads/src/io-threads.c:2295]: (style) The scope of the variable waitstat can be reduced [./xlators/performance/io-threads/src/io-threads.c:2410]: (style) The scope of the variable waitstat can be reduced [./xlators/performance/quick-read/src/quick-read.c:158]: (style) The scope of the variable ret can be reduced [./xlators/performance/quick-read/src/quick-read.c:256]: (style) The scope of the variable requested_size can be reduced [./xlators/performance/quick-read/src/quick-read.c:256]: (style) The scope of the variable size can be reduced [./xlators/performance/quick-read/src/quick-read.c:756]: (style) The scope of the variable flags can be reduced [./xlators/performance/quick-read/src/quick-read.c:756]: (style) The scope of the variable i can be reduced [./xlators/performance/quick-read/src/quick-read.c:758]: (style) The scope of the variable need_open can be reduced [./xlators/performance/quick-read/src/quick-read.c:758]: (style) The scope of the variable can_wind can be reduced [./xlators/performance/quick-read/src/quick-read.c:770]: (style) The scope of the variable start can be reduced [./xlators/performance/quick-read/src/quick-read.c:770]: (style) The scope of the variable end can be reduced [./xlators/performance/quick-read/src/quick-read.c:771]: (style) The scope of the variable len can be reduced [./xlators/performance/read-ahead/src/page.c:135]: (style) Variable 'payload_size' is assigned a value that is never used [./xlators/performance/read-ahead/src/page.c:135]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/page.c:340]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/page.c:269]: (style) The scope of the variable src_offset can be reduced [./xlators/performance/read-ahead/src/page.c:270]: (style) The scope of the variable dst_offset can be reduced [./xlators/performance/read-ahead/src/page.c:271]: (style) The scope of the variable copy_size can be reduced [./xlators/performance/read-ahead/src/read-ahead.c:48]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:127]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:440]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:555]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:586]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:621]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:643]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:700]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:733]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:766]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/read-ahead/src/read-ahead.c:704]: (style) The scope of the variable ret can be reduced [./xlators/performance/read-ahead/src/read-ahead.c:737]: (style) The scope of the variable ret can be reduced [./xlators/performance/read-ahead/src/read-ahead.c:770]: (style) The scope of the variable ret can be reduced [./xlators/performance/stat-prefetch/src/stat-prefetch.c:738]: (style) Variable 'ret' is assigned a value that is never used [./xlators/performance/stat-prefetch/src/stat-prefetch.c:153]: (style) The scope of the variable ret can be reduced [./xlators/performance/stat-prefetch/src/stat-prefetch.c:589]: (style) The scope of the variable ret can be reduced [./xlators/performance/stat-prefetch/src/stat-prefetch.c:693]: (style) The scope of the variable expected_offset can be reduced [./xlators/performance/symlink-cache/src/symlink-cache.c:97]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:210]: (style) The scope of the variable count can be reduced [./xlators/performance/write-behind/src/write-behind.c:531]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:600]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:674]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:715]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:789]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:862]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:938]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:981]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:1057]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:1132]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:1305]: (style) The scope of the variable flags can be reduced [./xlators/performance/write-behind/src/write-behind.c:1781]: (style) The scope of the variable count can be reduced [./xlators/performance/write-behind/src/write-behind.c:1972]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:2016]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:2096]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:2097]: (style) The scope of the variable disabled can be reduced [./xlators/performance/write-behind/src/write-behind.c:2098]: (style) The scope of the variable disable_till can be reduced [./xlators/performance/write-behind/src/write-behind.c:2168]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:2289]: (style) The scope of the variable ret can be reduced [./xlators/performance/write-behind/src/write-behind.c:2345]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:3434]: (error) Possible null pointer dereference: iobuf - otherwise it is redundant to check if iobuf is null at line 3505 [./xlators/protocol/client/src/client-protocol.c:1474]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/client/src/client-protocol.c:1674]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/client/src/client-protocol.c:2392]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/client/src/client-protocol.c:2460]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/client/src/client-protocol.c:2527]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/client/src/client-protocol.c:360]: (style) The scope of the variable transport_activity can be reduced [./xlators/protocol/client/src/client-protocol.c:436]: (style) The scope of the variable frame_count can be reduced [./xlators/protocol/client/src/client-protocol.c:589]: (style) The scope of the variable callid can be reduced [./xlators/protocol/client/src/client-protocol.c:3818]: (style) The scope of the variable dict_len can be reduced [./xlators/protocol/client/src/client-protocol.c:3820]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:3877]: (style) The scope of the variable dict_len can be reduced [./xlators/protocol/client/src/client-protocol.c:3879]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:3947]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:4147]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:4205]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:4468]: (style) The scope of the variable buf_size can be reduced [./xlators/protocol/client/src/client-protocol.c:4497]: (style) The scope of the variable buf_size can be reduced [./xlators/protocol/client/src/client-protocol.c:4676]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:4896]: (style) The scope of the variable dict_len can be reduced [./xlators/protocol/client/src/client-protocol.c:4898]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:5271]: (style) The scope of the variable dict_len can be reduced [./xlators/protocol/client/src/client-protocol.c:5273]: (style) The scope of the variable ret can be reduced [./xlators/protocol/client/src/client-protocol.c:737]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:807]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:862]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:918]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:987]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1053]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1109]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1165]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1234]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1314]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1397]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1452]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1525]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1598]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1655]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1723]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1792]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1860]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:1944]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2021]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2112]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2172]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2251]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2310]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2373]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2508]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2576]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2695]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2764]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2830]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:2928]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:3020]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:3127]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:3189]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:3267]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:3859]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:3918]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:4980]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:5318]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:5568]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:5638]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/client/src/client-protocol.c:6783]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/server/src/server-helpers.c:194]: (style) The scope of the variable i can be reduced [./xlators/protocol/server/src/server-helpers.c:699]: (style) The scope of the variable i can be reduced [./xlators/protocol/server/src/server-helpers.c:633]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./xlators/protocol/server/src/server-helpers.c:836]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./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 [./xlators/protocol/server/src/server-protocol.c:4400]: (style) Variable 'vollen' is assigned a value that is never used [./xlators/protocol/server/src/server-protocol.c:4554]: (style) Variable 'vollen' is assigned a value that is never used [./xlators/protocol/server/src/server-protocol.c:4611]: (style) Variable 'vollen' is assigned a value that is never used [./xlators/protocol/server/src/server-protocol.c:4776]: (style) Variable 'newbaselen' is assigned a value that is never used [./xlators/protocol/server/src/server-protocol.c:4842]: (style) Variable 'newbaselen' is assigned a value that is never used [./xlators/protocol/server/src/server-protocol.c:5570]: (style) Variable 'op_errno' is assigned a value that is never used [./xlators/protocol/server/src/server-protocol.c:899]: (style) The scope of the variable buflen can be reduced [./xlators/protocol/server/src/server-protocol.c:1212]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:1266]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:2383]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:2491]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:2553]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:2644]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:3429]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:3508]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:3585]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:3663]: (style) The scope of the variable ret can be reduced [./xlators/protocol/server/src/server-protocol.c:5573]: (style) The scope of the variable op_errno can be reduced [./xlators/protocol/server/src/server-protocol.c:5699]: (style) The scope of the variable lru_limit can be reduced [./xlators/protocol/server/src/server-protocol.c:5968]: (style) The scope of the variable glusterfsd_stats_nr_clients can be reduced [./xlators/protocol/server/src/server-protocol.c:5301]: (possible error) Memory leak: conf_dir [./xlators/protocol/server/src/server-resolve.c:99]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/server/src/server-resolve.c:138]: (style) Variable 'ret' is assigned a value that is never used [./xlators/protocol/server/src/server-resolve.c:104]: (style) The scope of the variable ret can be reduced [./xlators/storage/posix/src/posix.c:2321]: (style) Variable 'was_present' is assigned a value that is never used [./xlators/storage/posix/src/posix.c:2435]: (style) Variable 'align' is assigned a value that is never used [./xlators/storage/posix/src/posix.c:105]: (style) The scope of the variable xattr_size can be reduced [./xlators/storage/posix/src/posix.c:108]: (style) The scope of the variable _fd can be reduced [./xlators/storage/posix/src/posix.c:110]: (style) The scope of the variable req_size can be reduced [./xlators/storage/posix/src/posix.c:1236]: (style) The scope of the variable tmp_fd can be reduced [./xlators/storage/posix/src/posix.c:1474]: (style) The scope of the variable ret can be reduced [./xlators/storage/posix/src/posix.c:2328]: (style) The scope of the variable was_present can be reduced [./xlators/storage/posix/src/posix.c:2446]: (style) The scope of the variable align can be reduced [./xlators/storage/posix/src/posix.c:2561]: (style) The scope of the variable idx can be reduced [./xlators/storage/posix/src/posix.c:2562]: (style) The scope of the variable align can be reduced [./xlators/storage/posix/src/posix.c:2563]: (style) The scope of the variable max_buf_size can be reduced [./xlators/storage/posix/src/posix.c:2564]: (style) The scope of the variable retval can be reduced [./xlators/storage/posix/src/posix.c:2935]: (style) The scope of the variable file_fd can be reduced [./xlators/storage/posix/src/posix.c:2937]: (style) The scope of the variable ret can be reduced [./xlators/storage/posix/src/posix.c:3014]: (style) The scope of the variable sys_ret can be reduced [./xlators/storage/posix/src/posix.c:4557]: (style) The scope of the variable avg_read can be reduced [./xlators/storage/posix/src/posix.c:4558]: (style) The scope of the variable avg_write can be reduced [./xlators/storage/posix/src/posix.c:4559]: (style) The scope of the variable _time_ms can be reduced [./booster/src/booster_stat.c:1]: (style) The function '__fxstat' is never used [./booster/src/booster_stat.c:1]: (style) The function '__fxstat64' is never used [./booster/src/booster_stat.c:1]: (style) The function '__lxstat' is never used [./booster/src/booster_stat.c:1]: (style) The function '__lxstat64' is never used [./booster/src/booster_stat.c:1]: (style) The function '__xstat' is never used [./booster/src/booster_stat.c:1]: (style) The function '__xstat64' is never used [./xlators/cluster/afr/src/afr.c:1]: (style) The function 'afr_deitransform_orig' is never used [./libglusterfs/src/spec.lex.c:1]: (style) The function 'alloc_string' is never used [./libglusterfs/src/dict.c:1]: (style) The function 'data_copy' is never used [./libglusterfs/src/defaults.c:1]: (style) The function 'default_lock_fnotify_cbk' is never used [./libglusterfs/src/dict.c:1]: (style) The function 'dict_serialize_old' is never used [./libglusterfs/src/dict.c:1]: (style) The function 'dict_serialized_length_old' is never used [./libglusterfs/src/dict.c:1]: (style) The function 'dict_unserialize_old' is never used [./booster/src/booster.c:1]: (style) The function 'dup2' is never used [./xlators/debug/error-gen/src/error-gen.c:1]: (style) The function 'error_gen_forget' is never used [./booster/src/booster_stat.c:1]: (style) The function 'fstat64' is never used [:1]: (style) The function 'gf_auth' is never used [./libglusterfs/src/logging.c:1]: (style) The function 'gf_log_fini' is never used [./libglusterfs/src/common-utils.c:1]: (style) The function 'gf_str_to_long_long' is never used [./transport/ib-verbs/src/ib-verbs.c:1]: (style) The function 'ib_verbs_destroy_post' is never used [./xlators/debug/io-stats/src/io-stats.c:1]: (style) The function 'io_stats_forget' is never used [./xlators/performance/io-cache/src/io-cache.c:1]: (style) The function 'ioc_get_inode' is never used [./libglusterfsclient/src/libglusterfsclient.c:1]: (style) The function 'libgf_del_inode_ctx' is never used [./libglusterfsclient/src/libglusterfsclient.c:1]: (style) The function 'libgf_vmp_get_ghandle' is never used [./booster/src/booster.c:1]: (style) The function 'lseek64' is never used [./booster/src/booster_stat.c:1]: (style) The function 'lstat64' is never used [./xlators/cluster/map/src/map.c:1]: (style) The function 'map_lock_fnotify_cbk' is never used [./xlators/cluster/map/src/map.c:1]: (style) The function 'map_lock_notify_cbk' is never used [./booster/src/booster.c:1]: (style) The function 'mkfifo' is never used [./libglusterfs/src/spec.lex.c:1]: (style) The function 'new_string' is never used [./xlators/features/path-convertor/src/path.c:1]: (style) The function 'path_getdents_cbk' is never used [./xlators/features/path-convertor/src/path.c:1]: (style) The function 'path_readdir_cbk' is never used [./xlators/features/locks/src/posix.c:1]: (style) The function 'pl_dump_inode' is never used [./xlators/storage/posix/src/posix.c:1]: (style) The function 'posix_print_xattr' is never used [./booster/src/booster.c:1]: (style) The function 'pread64' is never used [./booster/src/booster.c:1]: (style) The function 'pwrite' is never used [./booster/src/booster.c:1]: (style) The function 'pwrite64' is never used [./xlators/features/quota/src/quota.c:1]: (style) The function 'quota_removexattr_cbk' is never used [./booster/src/booster.c:1]: (style) The function 'remove' is never used [./booster/src/booster.c:1]: (style) The function 'sendfile' is never used [./booster/src/booster.c:1]: (style) The function 'sendfile64' is never used [./xlators/protocol/server/src/server-protocol.c:1]: (style) The function 'server_fentrylk_resume' is never used [./xlators/protocol/server/src/server-helpers.c:1]: (style) The function 'server_loc_fill' is never used [./xlators/performance/stat-prefetch/src/stat-prefetch.c:1]: (style) The function 'sp_del_cache_fd' is never used [./xlators/performance/stat-prefetch/src/stat-prefetch.c:1]: (style) The function 'sp_put_cache' is never used [./booster/src/booster_stat.c:1]: (style) The function 'stat64' is never used [./booster/src/booster_stat.c:1]: (style) The function 'statfs64' is never used [./booster/src/booster_stat.c:1]: (style) The function 'statvfs64' is never used [./xlators/cluster/stripe/src/stripe.c:1]: (style) The function 'stripe_common_buf_cbk' is never used [./xlators/cluster/stripe/src/stripe.c:1]: (style) The function 'stripe_common_cbk' is never used [./xlators/cluster/stripe/src/stripe.c:1]: (style) The function 'stripe_common_remove_cbk' is never used [./xlators/cluster/stripe/src/stripe.c:1]: (style) The function 'stripe_single_readv_cbk' is never used [./xlators/cluster/stripe/src/stripe.c:1]: (style) The function 'stripe_single_writev_cbk' is never used [./xlators/protocol/server/src/server-protocol.c:1]: (style) The function 'unknown_op_cbk' is never used [./xlators/performance/write-behind/src/write-behind.c:1]: (style) The function 'wb_request_ref' is never used theia glusterfs-3.0.3 # ----------------------------- Removing the style issues reduces the whole report down to those errors/possible errors: ----------------------------- [./libglusterfs/src/dict.c:83]: (error) Memory leak: dict [./libglusterfs/src/dict.c:179]: (error) Memory leak: newdata [./libglusterfs/src/dict.c:251]: (possible error) Memory leak: pair [./libglusterfs/src/fd.c:464]: (error) Possible null pointer dereference: fd - otherwise it is redundant to check if fd is null at line 466 [./libglusterfs/src/y.tab.c:1743]: (possible error) Memory leak: node [./libglusterfs/src/y.tab.c:2067]: (possible error) Memory leak: cmd [./xlators/cluster/dht/src/switch.c:858]: (error) Memory leak: dup_str [./xlators/protocol/client/src/client-protocol.c:3434]: (error) Possible null pointer dereference: iobuf - otherwise it is redundant to check if iobuf is null at line 3505 [./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 [./xlators/protocol/server/src/server-protocol.c:5301]: (possible error) Memory leak: conf_dir ----------------------------- I tested the whole 3.0.3 tree with clang and build-scan but the report in html is insane 388 MB big. If I tar and gzip it then I can get it down to about 33.9 MB but that is probably still to big to send it to the mailing list. Compressing with 7-Zip reduces the whole report down to 2.8 MB. I think this is small enough to send to the developers of GlusterFS but still to big to be sent to all mailing list users. If you or any Gluster developer is interested in the report then let me know where to send that 2.8 MB report to? The overall summary when checking with clang is: ----------------------------- Bug Summary =========== Bug Type Quantity Display? ---------------------------------------- All Bugs 665 API --- Argument with 'nonnull' attribute passed null 9 Dead store ---------- Dead assignment 384 Dead increment 7 Dead initialization 10 Dead nested assignment 7 Logic errors ------------ Dereference of undefined pointer value 2 Division-by-zero 2 Null dereference 242 Uninitialized argument 1 Use of uninitialized value 1 ----------------------------- > Csaba > Steve -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser