<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-forward-container">FYI,<br>
      <br>
      This run done on the 3.6 branch.<br>
      <br>
      To fix these Coverity issues , please check the below link for
      guidelines:<br>
      <a class="moz-txt-link-freetext"
href="http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity">http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity</a><br>
      <br>
      Thanks,<br>
      Lala<br>
      -------- Original Message --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject:
            </th>
            <td>New Defects reported by Coverity Scan for GlusterFS</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
            <td>Thu, 25 Sep 2014 02:27:13 -0700</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
            <td><a class="moz-txt-link-abbreviated" href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>Hi,


Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 20 of 50 defect(s)


** CID 1124760:  Resource leak  (RESOURCE_LEAK)
/xlators/cluster/afr/src/afr-inode-read.c: 1043 in afr_fgetxattr_pathinfo_cbk()

** CID 1124795:  Resource leak  (RESOURCE_LEAK)
/xlators/protocol/client/src/client-helpers.c: 237 in unserialize_rsp_direntp()

** CID 1174824:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-store.c: 4112 in glusterd_store_retrieve_peers()

** CID 1124533:  Explicit null dereferenced  (FORWARD_NULL)
/xlators/protocol/client/src/client-rpc-fops.c: 5699 in client3_3_readdir()

** CID 1124749:  Resource leak  (RESOURCE_LEAK)
/xlators/cluster/afr/src/afr-common.c: 2229 in __afr_fd_ctx_set()

** CID 1128922:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 167 in bd_lookup_cbk()

** CID 1128921:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1167 in bd_offload_getx_cbk()

** CID 1128920:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 248 in bd_readdirp_cbk()

** CID 1128919:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1963 in bd_setattr()

** CID 1128918:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1062 in bd_setx_stat_cbk()

** CID 1128917:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1609 in bd_trunc_setxattr_cbk()

** CID 1124788:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-mountbroker.c: 338 in make_ghadoop_mountspec()

** CID 1128916:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd-helper.c: 347 in bd_validate_bd_xattr()

** CID 1124789:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-mountbroker.c: 692 in glusterd_do_mount()

** CID 1124759:  Resource leak  (RESOURCE_LEAK)
/xlators/debug/io-stats/src/io-stats.c: 2926 in init()
/xlators/performance/io-threads/src/io-threads.c: 1012 in init()
/xlators/mgmt/glusterd/src/glusterd.c: 1559 in init()

** CID 1124787:  Resource leak  (RESOURCE_LEAK)
/xlators/cluster/afr/src/afr-inode-read.c: 1163 in afr_getxattr_pathinfo_cbk()

** CID 1124745:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/posix/src/posix.c: 5867 in init()

** CID 1124731:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-brick-ops.c: 990 in _glusterd_restart_gsync_session()

** CID 1124776:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3227 in nfs_option_handler()

** CID 1124770:  Resource leak  (RESOURCE_LEAK)
/rpc/rpc-lib/src/rpc-transport.c: 341 in rpc_transport_load()


________________________________________________________________________________________________________
*** CID 1124760:  Resource leak  (RESOURCE_LEAK)
/xlators/cluster/afr/src/afr-inode-read.c: 1043 in afr_fgetxattr_pathinfo_cbk()
1037                                       local-&gt;op_errno, nxattr, local-&gt;xdata_rsp);
1038     
1039                     if (nxattr)
1040                             dict_unref (nxattr);
1041             }
1042     
&gt;&gt;&gt;     CID 1124760:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "xattr_serz" going out of scope leaks the storage it points to.
1043             return ret;
1044     }
1045     
1046     int32_t
1047     afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie,
1048                                xlator_t *this, int32_t op_ret, int32_t op_errno,

________________________________________________________________________________________________________
*** CID 1124795:  Resource leak  (RESOURCE_LEAK)
/xlators/protocol/client/src/client-helpers.c: 237 in unserialize_rsp_direntp()
231     
232                     trav = trav-&gt;nextentry;
233             }
234     
235             ret = 0;
236     out:
&gt;&gt;&gt;     CID 1124795:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "buf" going out of scope leaks the storage it points to.
237             return ret;
238     }
239     
240     int
241     clnt_readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp)
242     {

________________________________________________________________________________________________________
*** CID 1174824:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-store.c: 4112 in glusterd_store_retrieve_peers()
4106                     glusterd_peerinfo_cleanup (peerinfo);
4107     
4108             if (dir)
4109                     closedir (dir);
4110             gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
4111     
&gt;&gt;&gt;     CID 1174824:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "iter" going out of scope leaks the storage it points to.
4112             return ret;
4113     }
4114     
4115     /* Bricks for snap volumes are hosted at /var/run/gluster/snaps
4116      * When a volume is restored, it points to the bricks of the snap
4117      * volume it was restored from. Hence on a node restart these

________________________________________________________________________________________________________
*** CID 1124533:  Explicit null dereferenced  (FORWARD_NULL)
/xlators/protocol/client/src/client-rpc-fops.c: 5699 in client3_3_readdir()
5693             }
5694     
5695             req.size = args-&gt;size;
5696             req.offset = args-&gt;offset;
5697             req.fd = remote_fd;
5698     
&gt;&gt;&gt;     CID 1124533:  Explicit null dereferenced  (FORWARD_NULL)
&gt;&gt;&gt;     Dereferencing null pointer "local".
5699             local-&gt;cmd = remote_fd;
5700     
5701             memcpy (req.gfid, args-&gt;fd-&gt;inode-&gt;gfid, 16);
5702             GF_PROTOCOL_DICT_SERIALIZE (this, args-&gt;xdata, (&amp;req.xdata.xdata_val),
5703                                         req.xdata.xdata_len, op_errno, unwind);
5704     

________________________________________________________________________________________________________
*** CID 1124749:  Resource leak  (RESOURCE_LEAK)
/xlators/cluster/afr/src/afr-common.c: 2229 in __afr_fd_ctx_set()
2223     
2224             ret = __fd_ctx_set (fd, this, (uint64_t)(long) fd_ctx);
2225             if (ret)
2226                     gf_log (this-&gt;name, GF_LOG_DEBUG,
2227                             "failed to set fd ctx (%p)", fd);
2228     out:
&gt;&gt;&gt;     CID 1124749:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "fd_ctx" going out of scope leaks the storage it points to.
2229             return ret;
2230     }
2231     
2232     
2233     int
2234     afr_fd_ctx_set (xlator_t *this, fd_t *fd)

________________________________________________________________________________________________________
*** CID 1128922:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 167 in bd_lookup_cbk()
161             dict_del (xattr, GF_CONTENT_KEY);
162             memcpy (buf, &amp;bdatt-&gt;iatt, sizeof (struct iatt));
163     
164     out:
165             BD_STACK_UNWIND (lookup, frame, op_ret, op_errno, inode, buf,
166                              xattr, postparent);
&gt;&gt;&gt;     CID 1128922:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "type" going out of scope leaks the storage it points to.
167             return 0;
168     }
169     
170     /*
171      * bd_lookup: Issues posix_lookup to find out if file is mapped to BD
172      * bd_lookup -&gt; posix_lookup -&gt; bd_lookup_cbk

________________________________________________________________________________________________________
*** CID 1128921:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1167 in bd_offload_getx_cbk()
1161             }
1162     
1163             STACK_WIND (frame, bd_offload_setx_cbk, FIRST_CHILD(this),
1164                         FIRST_CHILD(this)-&gt;fops-&gt;setxattr,
1165                         local-&gt;dloc, local-&gt;dict, 0, NULL);
1166     
&gt;&gt;&gt;     CID 1128921:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "type" going out of scope leaks the storage it points to.
1167             return 0;
1168     
1169     out:
1170             if (local-&gt;fd)
1171                     BD_STACK_UNWIND (fsetxattr, frame, -1, op_errno, NULL);
1172             else

________________________________________________________________________________________________________
*** CID 1128920:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 248 in bd_readdirp_cbk()
242                             GF_FREE (type);
243                     }
244             }
245     
246     out:
247             BD_STACK_UNWIND (readdirp, frame, op_ret, op_errno, entries, xdata);
&gt;&gt;&gt;     CID 1128920:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "type" going out of scope leaks the storage it points to.
248             return 0;
249     }
250     
251     /*
252      * bd_readdirp: In bd_readdirp_cbk if the file and BD_XATTR_SIZE is set
253      * ia_size is updated with the LV(BD_XATTR_SIZE) size

________________________________________________________________________________________________________
*** CID 1128919:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1963 in bd_setattr()
1957             *ck_valid = valid;
1958     
1959             STACK_WIND_COOKIE (frame, bd_setattr_cbk, ck_valid, FIRST_CHILD(this),
1960                                FIRST_CHILD(this)-&gt;fops-&gt;setattr,
1961                                loc, stbuf, valid, xdata);
1962     
&gt;&gt;&gt;     CID 1128919:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "ck_valid" going out of scope leaks the storage it points to.
1963             return 0;
1964     out:
1965             BD_STACK_UNWIND (setattr, frame, -1, ENOMEM, NULL, NULL, xdata);
1966             return 0;
1967     }
1968     

________________________________________________________________________________________________________
*** CID 1128918:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1062 in bd_setx_stat_cbk()
1056                                 local-&gt;fd, local-&gt;dict, 0, NULL);
1057             else
1058                     STACK_WIND (frame, bd_setx_setx_cbk, FIRST_CHILD(this),
1059                                 FIRST_CHILD(this)-&gt;fops-&gt;setxattr,
1060                                 &amp;local-&gt;loc, local-&gt;dict, 0, NULL);
1061     
&gt;&gt;&gt;     CID 1128918:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "param" going out of scope leaks the storage it points to.
1062             return 0;
1063     
1064     out:
1065             if (local-&gt;fd)
1066                     BD_STACK_UNWIND (fsetxattr, frame, -1, op_errno, xdata);
1067             else

________________________________________________________________________________________________________
*** CID 1128917:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd.c: 1609 in bd_trunc_setxattr_cbk()
1603             else
1604                     STACK_WIND (frame, bd_trunc_setxattr_setx_cbk,
1605                                 FIRST_CHILD(this),
1606                                 FIRST_CHILD(this)-&gt;fops-&gt;setxattr,
1607                                 &amp;local-&gt;loc, local-&gt;dict, 0, NULL);
1608     
&gt;&gt;&gt;     CID 1128917:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "bd" going out of scope leaks the storage it points to.
1609             return 0;
1610     out:
1611             if (local-&gt;fd)
1612                     BD_STACK_UNWIND (ftruncate, frame, -1, EIO, NULL, NULL, NULL);
1613             else
1614                     BD_STACK_UNWIND (truncate, frame, -1, EIO, NULL, NULL, NULL);

________________________________________________________________________________________________________
*** CID 1124788:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-mountbroker.c: 338 in make_ghadoop_mountspec()
332     
333             ret = gf_asprintf (&amp;hadoop_mnt_desc, hadoop_mnt_desc_template,
334                                server, GF_CLIENT_PID_HADOOP, volname, user);
335             if (ret == -1)
336                     return ret;
337     
&gt;&gt;&gt;     CID 1124788:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "hadoop_mnt_desc" going out of scope leaks the storage it points to.
338             return parse_mount_pattern_desc (mspec, hadoop_mnt_desc);
339     }
340     
341     static gf_boolean_t
342     match_comp (char *str, char *patcomp)
343     {

________________________________________________________________________________________________________
*** CID 1128916:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/bd/src/bd-helper.c: 347 in bd_validate_bd_xattr()
341             }
342     
343             /* Destination file does not exist */
344             if (stat (path, &amp;stbuf)) {
345                     gf_log (this-&gt;name, GF_LOG_WARNING,
346                             "lstat failed for path %s", path);
&gt;&gt;&gt;     CID 1128916:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "path" going out of scope leaks the storage it points to.
347                     return -1;
348             }
349     
350             vg = lvm_vg_open (priv-&gt;handle, priv-&gt;vg, "r", 0);
351             if (!vg) {
352                     gf_log (this-&gt;name, GF_LOG_WARNING,

________________________________________________________________________________________________________
*** CID 1124789:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-mountbroker.c: 692 in glusterd_do_mount()
686                     ret = 0;
687                     *path = cookie;
688             }
689     
690             GF_FREE (mtptemp);
691     
&gt;&gt;&gt;     CID 1124789:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "mntlink" going out of scope leaks the storage it points to.
692             return ret;

________________________________________________________________________________________________________
*** CID 1124759:  Resource leak  (RESOURCE_LEAK)
/xlators/debug/io-stats/src/io-stats.c: 2926 in init()
2920     out:
2921             if (!this-&gt;private) {
2922                     ios_conf_destroy (conf);
2923                     ret = -1;
2924             }
2925     
&gt;&gt;&gt;     CID 1124759:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "conf" going out of scope leaks the storage it points to.
2926             return ret;
2927     }
2928     
2929     void
2930     fini (xlator_t *this)
2931     {
/xlators/performance/io-threads/src/io-threads.c: 1012 in init()
1006             this-&gt;private = conf;
1007             ret = 0;
1008     out:
1009             if (ret)
1010                     GF_FREE (conf);
1011     
&gt;&gt;&gt;     CID 1124759:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "conf" going out of scope leaks the storage it points to.
1012             return ret;
1013     }
1014     
1015     
1016     void
1017     fini (xlator_t *this)
/xlators/mgmt/glusterd/src/glusterd.c: 1559 in init()
1553                             GF_FREE (this-&gt;private);
1554                             this-&gt;private = NULL;
1555                     }
1556     
1557             }
1558     
&gt;&gt;&gt;     CID 1124759:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "conf" going out of scope leaks the storage it points to.
1559             return ret;
1560     }
1561     
1562     
1563     
1564     

________________________________________________________________________________________________________
*** CID 1124787:  Resource leak  (RESOURCE_LEAK)
/xlators/cluster/afr/src/afr-inode-read.c: 1163 in afr_getxattr_pathinfo_cbk()
1157                                       local-&gt;op_errno, nxattr, local-&gt;xdata_rsp);
1158     
1159                     if (nxattr)
1160                             dict_unref (nxattr);
1161             }
1162     
&gt;&gt;&gt;     CID 1124787:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "xattr_serz" going out of scope leaks the storage it points to.
1163             return ret;
1164     }
1165     
1166     static int
1167     afr_aggregate_stime_xattr (dict_t *this, char *key, data_t *value, void *data)
1168     {

________________________________________________________________________________________________________
*** CID 1124745:  Resource leak  (RESOURCE_LEAK)
/xlators/storage/posix/src/posix.c: 5867 in init()
5861             }
5862     #endif
5863     
5864             GF_OPTION_INIT ("batch-fsync-delay-usec", _private-&gt;batch_fsync_delay_usec,
5865                             uint32, out);
5866     out:
&gt;&gt;&gt;     CID 1124745:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "_private" going out of scope leaks the storage it points to.
5867             return ret;
5868     }
5869     
5870     void
5871     fini (xlator_t *this)
5872     {

________________________________________________________________________________________________________
*** CID 1124731:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-brick-ops.c: 990 in _glusterd_restart_gsync_session()
984             if (ret)
985                     gf_log ("", GF_LOG_ERROR,
986                             "Unable to restart gsync session.");
987     
988     out:
989             gf_log ("", GF_LOG_DEBUG, "Returning %d.", ret);
&gt;&gt;&gt;     CID 1124731:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "path_list" going out of scope leaks the storage it points to.
990             return ret;
991     }
992     
993     /* op-sm */
994     
995     int

________________________________________________________________________________________________________
*** CID 1124776:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3227 in nfs_option_handler()
3221                     ret = gf_asprintf (&amp;aa, "nfs3.%s.export-dir",
3222                                             volinfo-&gt;volname);
3223     
3224                     if (ret != -1) {
3225                             ret = gf_canonicalize_path (vme-&gt;value);
3226                             if (ret)
&gt;&gt;&gt;     CID 1124776:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "aa" going out of scope leaks the storage it points to.
3227                                     return -1;
3228     
3229                             ret = xlator_set_option (xl, aa, vme-&gt;value);
3230                             GF_FREE (aa);
3231                     }
3232     

________________________________________________________________________________________________________
*** CID 1124770:  Resource leak  (RESOURCE_LEAK)
/rpc/rpc-lib/src/rpc-transport.c: 341 in rpc_transport_load()
335             }
336     
337             return_trans = trans;
338     
339             GF_FREE (name);
340     
&gt;&gt;&gt;     CID 1124770:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "vol_opt" going out of scope leaks the storage it points to.
341             return return_trans;
342     
343     fail:
344             if (trans) {
345                     GF_FREE (trans-&gt;name);
346     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, <a class="moz-txt-link-freetext" href="http://scan.coverity.com/projects/987?tab=overview">http://scan.coverity.com/projects/987?tab=overview</a>

To unsubscribe from the email notification for new defects, <a class="moz-txt-link-freetext" href="http://scan5.coverity.com/cgi-bin/unsubscribe.py">http://scan5.coverity.com/cgi-bin/unsubscribe.py</a>



</pre>
      <br>
    </div>
    <br>
  </body>
</html>