[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs
scan-admin at coverity.com
scan-admin at coverity.com
Mon Feb 6 03:41:44 UTC 2017
Hi,
Please find the latest report on new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
70 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
52 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 20 of 70 defect(s)
** CID 1370957: Code maintainability issues (UNUSED_VALUE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 9610 in glusterd_volume_tier_use_rsp_dict()
________________________________________________________________________________________________________
*** CID 1370957: Code maintainability issues (UNUSED_VALUE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 9610 in glusterd_volume_tier_use_rsp_dict()
9604 ret = dict_get_str (rsp_dict, GF_REMOVE_BRICK_TID_KEY,
9605 &task_id_str);
9606 if (ret) {
9607 gf_msg_debug (this->name, errno,
9608 "Missing remove-brick-id");
9609 } else
>>> CID 1370957: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "dict_set_str(ctx_dict, "remove-brick-id", task_id_str)" to "ret" here, but that stored value is overwritten before it can be used.
9610 ret = dict_set_str (ctx_dict, GF_REMOVE_BRICK_TID_KEY,
9611 task_id_str);
9612
9613 ret = 0;
9614
9615 out:
** CID 1370956: Memory - illegal accesses (UNINIT)
/xlators/experimental/jbr-server/src/jbr-cg.c: 1182 in jbr_open_term()
________________________________________________________________________________________________________
*** CID 1370956: Memory - illegal accesses (UNINIT)
/xlators/experimental/jbr-server/src/jbr-cg.c: 1182 in jbr_open_term()
1176 void
1177 jbr_open_term (call_frame_t *frame, xlator_t *this, dict_t *xdata)
1178 {
1179 int32_t op_errno;
1180 char *cl_dir;
1181 char *term;
>>> CID 1370956: Memory - illegal accesses (UNINIT)
>>> Declaring variable "path" without initializer.
1182 char *path;
1183 jbr_private_t *priv = this->private;
1184
1185 op_errno = jbr_get_changelog_dir(this, &cl_dir);
1186 if (op_errno) {
1187 goto err;
** CID 1370955: Null pointer dereferences (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tier.c: 1374 in glusterd_op_tier_status()
________________________________________________________________________________________________________
*** CID 1370955: Null pointer dereferences (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tier.c: 1374 in glusterd_op_tier_status()
1368 goto out;
1369 }
1370
1371 GD_SYNCOP (rpc, (&args), NULL, glusterd_tier_status_cbk, req,
1372 &gd_brick_prog, req->op, xdr_gd1_mgmt_brick_op_req);
1373
>>> CID 1370955: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "req" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1374 if (req) {
1375 GF_FREE (req);
1376 req = NULL;
1377 }
1378 if (!ret)
1379 pending_bricks++;
** CID 1370954: Security best practices violations (SECURE_TEMP)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c: 157 in glusterd_svc_check_tier_topology_identical()
________________________________________________________________________________________________________
*** CID 1370954: Security best practices violations (SECURE_TEMP)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c: 157 in glusterd_svc_check_tier_topology_identical()
151
152 glusterd_svc_build_tierd_volfile_path (volinfo, orgvol,
153 sizeof (orgvol));
154
155 snprintf (tmpvol, sizeof (tmpvol), "/tmp/g%s-XXXXXX", svc_name);
156
>>> CID 1370954: Security best practices violations (SECURE_TEMP)
>>> Calling "mkstemp" without securely setting umask first.
157 tmpfd = mkstemp (tmpvol);
158 if (tmpfd < 0) {
159 gf_msg (this->name, GF_LOG_WARNING, errno,
160 GD_MSG_FILE_OP_FAILED, "Unable to create temp file"
161 " %s:(%s)", tmpvol, strerror (errno));
162 goto out;
** CID 1370953: Security best practices violations (SECURE_TEMP)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c: 104 in glusterd_svc_check_tier_volfile_identical()
________________________________________________________________________________________________________
*** CID 1370953: Security best practices violations (SECURE_TEMP)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c: 104 in glusterd_svc_check_tier_volfile_identical()
98
99 glusterd_svc_build_tierd_volfile_path (volinfo, orgvol,
100 sizeof (orgvol));
101
102 snprintf (tmpvol, sizeof (tmpvol), "/tmp/g%s-XXXXXX", svc_name);
103
>>> CID 1370953: Security best practices violations (SECURE_TEMP)
>>> Calling "mkstemp" without securely setting umask first.
104 tmp_fd = mkstemp (tmpvol);
105 if (tmp_fd < 0) {
106 gf_msg (this->name, GF_LOG_WARNING, errno,
107 GD_MSG_FILE_OP_FAILED, "Unable to create temp file"
108 " %s:(%s)", tmpvol, strerror (errno));
109 goto out;
** CID 1370952: Null pointer dereferences (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/system/posix-acl/src/posix-acl.c: 252 in posix_acl_log_permit_denied()
________________________________________________________________________________________________________
*** CID 1370952: Null pointer dereferences (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/system/posix-acl/src/posix-acl.c: 252 in posix_acl_log_permit_denied()
246 posix_acl_log_permit_denied (call_frame_t *frame, inode_t *inode, int want,
247 struct posix_acl_ctx *ctx, struct posix_acl *acl)
248 {
249 char *acl_str = NULL;
250 client_t *client = frame->root->client;
251
>>> CID 1370952: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "frame" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
252 if (!frame || !inode || !ctx)
253 goto out;
254
255 posix_acl_get_acl_string (frame, acl, &acl_str);
256
257 gf_msg (frame->this->name, GF_LOG_INFO, EACCES, POSIX_ACL_MSG_EACCES,
** CID 1370951: Null pointer dereferences (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/cluster/afr/src/afr-common.c: 5908 in afr_fav_child_reset_sink_xattrs_cbk()
________________________________________________________________________________________________________
*** CID 1370951: Null pointer dereferences (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/cluster/afr/src/afr-common.c: 5908 in afr_fav_child_reset_sink_xattrs_cbk()
5902 this = txn_frame->this;
5903
5904 /* Refresh the inode agan and proceed with the transaction.*/
5905 afr_inode_refresh (txn_frame, this, local->inode, NULL,
5906 local->refreshfn);
5907
>>> CID 1370951: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "heal_frame" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
5908 if (heal_frame)
5909 AFR_STACK_DESTROY (heal_frame);
5910
5911 return 0;
5912 }
5913
** CID 1370950: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
________________________________________________________________________________________________________
*** CID 1370950: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
11376 "option %s does not exist", key);
11377 if (*op_errstr == NULL)
11378 *op_errstr = gf_strdup (err_str);
11379 }
11380 gf_msg_debug (THIS->name, 0, "Returning %d", ret);
11381
>>> CID 1370950: (RESOURCE_LEAK)
>>> Variable "def_val" going out of scope leaks the storage it points to.
11382 return ret;
11383 }
11384
11385 int
11386 glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
11387 char *input_key, char *orig_key,
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
11376 "option %s does not exist", key);
11377 if (*op_errstr == NULL)
11378 *op_errstr = gf_strdup (err_str);
11379 }
11380 gf_msg_debug (THIS->name, 0, "Returning %d", ret);
11381
>>> CID 1370950: (RESOURCE_LEAK)
>>> Variable "def_val" going out of scope leaks the storage it points to.
11382 return ret;
11383 }
11384
11385 int
11386 glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
11387 char *input_key, char *orig_key,
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
11376 "option %s does not exist", key);
11377 if (*op_errstr == NULL)
11378 *op_errstr = gf_strdup (err_str);
11379 }
11380 gf_msg_debug (THIS->name, 0, "Returning %d", ret);
11381
>>> CID 1370950: (RESOURCE_LEAK)
>>> Variable "def_val" going out of scope leaks the storage it points to.
11382 return ret;
11383 }
11384
11385 int
11386 glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
11387 char *input_key, char *orig_key,
** CID 1370949: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/cli/src/cli-cmd-volume.c: 1070 in cli_cmd_volume_add_brick_cbk()
/home/vijay/workspace/glusterfs/glusterfs/cli/src/cli-cmd-volume.c: 1070 in cli_cmd_volume_add_brick_cbk()
________________________________________________________________________________________________________
*** CID 1370949: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/cli/src/cli-cmd-volume.c: 1070 in cli_cmd_volume_add_brick_cbk()
1064 gf_event (EVENT_VOLUME_ADD_BRICK, "%s", event_str);
1065 GF_FREE (event_str);
1066 #endif
1067 }
1068
1069 CLI_STACK_DESTROY (frame);
>>> CID 1370949: (RESOURCE_LEAK)
>>> Variable "event_str" going out of scope leaks the storage it points to.
1070 return ret;
1071 }
1072
1073 int
1074 cli_tier_validate_replica_type (dict_t *dict, int type)
1075 {
/home/vijay/workspace/glusterfs/glusterfs/cli/src/cli-cmd-volume.c: 1070 in cli_cmd_volume_add_brick_cbk()
1064 gf_event (EVENT_VOLUME_ADD_BRICK, "%s", event_str);
1065 GF_FREE (event_str);
1066 #endif
1067 }
1068
1069 CLI_STACK_DESTROY (frame);
>>> CID 1370949: (RESOURCE_LEAK)
>>> Variable "event_str" going out of scope leaks the storage it points to.
1070 return ret;
1071 }
1072
1073 int
1074 cli_tier_validate_replica_type (dict_t *dict, int type)
1075 {
** CID 1370948: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
________________________________________________________________________________________________________
*** CID 1370948: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
11376 "option %s does not exist", key);
11377 if (*op_errstr == NULL)
11378 *op_errstr = gf_strdup (err_str);
11379 }
11380 gf_msg_debug (THIS->name, 0, "Returning %d", ret);
11381
>>> CID 1370948: Resource leaks (RESOURCE_LEAK)
>>> Variable "key" going out of scope leaks the storage it points to.
11382 return ret;
11383 }
11384
11385 int
11386 glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
11387 char *input_key, char *orig_key,
** CID 1370947: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 666 in tear_down_cluster()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 666 in tear_down_cluster()
________________________________________________________________________________________________________
*** CID 1370947: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 666 in tear_down_cluster()
660 gf_msg_debug (THIS->name, 0, "Failed to close dir %s. Reason :"
661 " %s", CONFDIR, strerror (errno));
662 }
663 }
664
665 out:
>>> CID 1370947: (RESOURCE_LEAK)
>>> Variable "dir" going out of scope leaks the storage it points to.
666 return ret;
667 }
668
669
670 int
671 setup_cluster(gf_boolean_t run_setup)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 666 in tear_down_cluster()
660 gf_msg_debug (THIS->name, 0, "Failed to close dir %s. Reason :"
661 " %s", CONFDIR, strerror (errno));
662 }
663 }
664
665 out:
>>> CID 1370947: (RESOURCE_LEAK)
>>> Variable "dir" going out of scope leaks the storage it points to.
666 return ret;
667 }
668
669
670 int
671 setup_cluster(gf_boolean_t run_setup)
** CID 1370946: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
________________________________________________________________________________________________________
*** CID 1370946: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 11382 in glusterd_get_global_options_for_all_vols()
11376 "option %s does not exist", key);
11377 if (*op_errstr == NULL)
11378 *op_errstr = gf_strdup (err_str);
11379 }
11380 gf_msg_debug (THIS->name, 0, "Returning %d", ret);
11381
>>> CID 1370946: Resource leaks (RESOURCE_LEAK)
>>> Variable "allvolopt" going out of scope leaks the storage it points to.
11382 return ret;
11383 }
11384
11385 int
11386 glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
11387 char *input_key, char *orig_key,
** CID 1370945: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5364 in glusterd_get_state()
________________________________________________________________________________________________________
*** CID 1370945: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5364 in glusterd_get_state()
5358 fprintf (fp, "Volume%d.rebalance.skipped: %"PRIu64"\n", count,
5359 volinfo->rebal.skipped_files);
5360 fprintf (fp, "Volume%d.rebalance.lookedup: %"PRIu64"\n", count,
5361 volinfo->rebal.lookedup_files);
5362 fprintf (fp, "Volume%d.rebalance.files: %"PRIu64"\n", count,
5363 volinfo->rebal.rebalance_files);
>>> CID 1370945: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "gf_uint64_2human_readable(volinfo->rebal.rebalance_data)" leaks it.
5364 fprintf (fp, "Volume%d.rebalance.data: %s\n", count,
5365 gf_uint64_2human_readable (volinfo->rebal.rebalance_data));
5366
5367 if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
5368 ret = glusterd_volume_get_hot_tier_type_str (
5369 volinfo, &hot_tier_type_str);
** CID 1370944: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
________________________________________________________________________________________________________
*** CID 1370944: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
5476
5477 ret = dict_allocate_and_serialize (dict, &rsp.dict.dict_val,
5478 &rsp.dict.dict_len);
5479 glusterd_to_cli (req, &rsp, NULL, 0, NULL,
5480 (xdrproc_t)xdr_gf_cli_rsp, dict);
5481
>>> CID 1370944: Resource leaks (RESOURCE_LEAK)
>>> Variable "filename" going out of scope leaks the storage it points to.
5482 return ret;
5483 }
5484
5485 static int
5486 __glusterd_handle_get_state (rpcsvc_request_t *req)
5487 {
** CID 1370943: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
________________________________________________________________________________________________________
*** CID 1370943: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
5476
5477 ret = dict_allocate_and_serialize (dict, &rsp.dict.dict_val,
5478 &rsp.dict.dict_len);
5479 glusterd_to_cli (req, &rsp, NULL, 0, NULL,
5480 (xdrproc_t)xdr_gf_cli_rsp, dict);
5481
>>> CID 1370943: (RESOURCE_LEAK)
>>> Variable "odir" going out of scope leaks the storage it points to.
5482 return ret;
5483 }
5484
5485 static int
5486 __glusterd_handle_get_state (rpcsvc_request_t *req)
5487 {
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
5476
5477 ret = dict_allocate_and_serialize (dict, &rsp.dict.dict_val,
5478 &rsp.dict.dict_len);
5479 glusterd_to_cli (req, &rsp, NULL, 0, NULL,
5480 (xdrproc_t)xdr_gf_cli_rsp, dict);
5481
>>> CID 1370943: (RESOURCE_LEAK)
>>> Variable "odir" going out of scope leaks the storage it points to.
5482 return ret;
5483 }
5484
5485 static int
5486 __glusterd_handle_get_state (rpcsvc_request_t *req)
5487 {
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5482 in glusterd_get_state()
5476
5477 ret = dict_allocate_and_serialize (dict, &rsp.dict.dict_val,
5478 &rsp.dict.dict_len);
5479 glusterd_to_cli (req, &rsp, NULL, 0, NULL,
5480 (xdrproc_t)xdr_gf_cli_rsp, dict);
5481
>>> CID 1370943: (RESOURCE_LEAK)
>>> Variable "odir" going out of scope leaks the storage it points to.
5482 return ret;
5483 }
5484
5485 static int
5486 __glusterd_handle_get_state (rpcsvc_request_t *req)
5487 {
** CID 1370942: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5191 in glusterd_get_state()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5283 in glusterd_get_state()
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5352 in glusterd_get_state()
________________________________________________________________________________________________________
*** CID 1370942: (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5191 in glusterd_get_state()
5185 ret = -1;
5186 goto out;
5187 }
5188
5189 fprintf (fp, "[Global]\n");
5190
>>> CID 1370942: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "gf_strdup(uuid_utoa(priv->uuid))" leaks it.
5191 fprintf (fp, "MYUUID: %s\n", gf_strdup (uuid_utoa (priv->uuid)));
5192 fprintf (fp, "op-version: %d\n", priv->op_version);
5193
5194 fprintf (fp, "\n[Global options]\n");
5195
5196 if (priv->opts)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5283 in glusterd_get_state()
5277 "Failed to get rebalance status for volume: %s",
5278 volinfo->volname);
5279 goto out;
5280 }
5281
5282 fprintf (fp, "Volume%d.name: %s\n", ++count, volinfo->volname);
>>> CID 1370942: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "gf_strdup(uuid_utoa(volinfo->volume_id))" leaks it.
5283 fprintf (fp, "Volume%d.id: %s\n", count,
5284 gf_strdup (uuid_utoa (volinfo->volume_id)));
5285 fprintf (fp, "Volume%d.type: %s\n", count, vol_type_str);
5286 fprintf (fp, "Volume%d.transport_type: %s\n", count,
5287 transport_type_str);
5288 fprintf (fp, "Volume%d.status: %s\n", count, vol_status_str);
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5352 in glusterd_get_state()
5346
5347 fprintf (fp, "Volume%d.snapd_svc.online_status: %s\n", count,
5348 volinfo->snapd.svc.online ? "Online" : "Offline");
5349 fprintf (fp, "Volume%d.snapd_svc.inited: %s\n", count,
5350 volinfo->snapd.svc.inited ? "True" : "False");
5351
>>> CID 1370942: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "gf_strdup(uuid_utoa(volinfo->rebal.rebalance_id))" leaks it.
5352 fprintf (fp, "Volume%d.rebalance.id: %s\n", count,
5353 gf_strdup (uuid_utoa (volinfo->rebal.rebalance_id)));
5354 fprintf (fp, "Volume%d.rebalance.status: %s\n", count,
5355 rebal_status_str);
5356 fprintf (fp, "Volume%d.rebalance.failures: %"PRIu64"\n", count,
5357 volinfo->rebal.rebalance_failures);
** CID 1370941: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5069 in glusterd_print_snapinfo_by_vol()
________________________________________________________________________________________________________
*** CID 1370941: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-handler.c: 5069 in glusterd_print_snapinfo_by_vol()
5063 }
5064 gf_time_fmt (timestr, sizeof timestr, snapinfo->time_stamp,
5065 gf_timefmt_FT);
5066
5067 fprintf (fp, "Volume%d.snapshot%d.name: %s\n",
5068 volcount, snapcount, snapinfo->snapname);
>>> CID 1370941: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "gf_strdup(uuid_utoa(snapinfo->snap_id))" leaks it.
5069 fprintf (fp, "Volume%d.snapshot%d.id: %s\n", volcount, snapcount,
5070 gf_strdup (uuid_utoa (snapinfo->snap_id)));
5071 fprintf (fp, "Volume%d.snapshot%d.time: %s\n",
5072 volcount, snapcount, timestr);
5073
5074 if (snapinfo->description)
** CID 1370940: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/cli/src/cli-cmd-parser.c: 1037 in cli_cmd_get_state_parse()
________________________________________________________________________________________________________
*** CID 1370940: Resource leaks (RESOURCE_LEAK)
/home/vijay/workspace/glusterfs/glusterfs/cli/src/cli-cmd-parser.c: 1037 in cli_cmd_get_state_parse()
1031 if (dict)
1032 *options = dict;
1033
1034 if (ret && dict)
1035 dict_unref (dict);
1036
>>> CID 1370940: Resource leaks (RESOURCE_LEAK)
>>> Variable "daemon_name" going out of scope leaks the storage it points to.
1037 return ret;
1038 }
1039
1040 int32_t
1041 cli_cmd_inode_quota_parse (const char **words, int wordcount, dict_t **options)
1042 {
** CID 1370939: Memory - illegal accesses (OVERRUN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/cluster/ec/src/ec-code-x64.c: 54 in ec_code_x64_epilog()
________________________________________________________________________________________________________
*** CID 1370939: Memory - illegal accesses (OVERRUN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/cluster/ec/src/ec-code-x64.c: 54 in ec_code_x64_epilog()
48 ec_code_intel_op_jne(builder, builder->loop);
49
50 if (builder->regs > 11) {
51 ec_code_error(builder, EINVAL);
52 }
53 for (i = builder->regs; i > 7; i--) {
>>> CID 1370939: Memory - illegal accesses (OVERRUN)
>>> Overrunning array "ec_code_x64_regmap" of 11 4-byte elements at element index 11 (byte offset 44) using index "i - 1U" (which evaluates to 11).
54 ec_code_intel_op_pop_r(builder, ec_code_x64_regmap[i - 1]);
55 }
56 if (!builder->linear) {
57 ec_code_intel_op_pop_r(builder, REG_BX);
58 }
59 ec_code_intel_op_pop_r(builder, REG_BP);
** CID 1370938: Memory - corruptions (OVERRUN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/storage/posix/src/posix-handle.c: 161 in posix_make_ancestryfromgfid()
________________________________________________________________________________________________________
*** CID 1370938: Memory - corruptions (OVERRUN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/storage/posix/src/posix-handle.c: 161 in posix_make_ancestryfromgfid()
155 if (__is_root_gfid (tmp_gfid)) {
156
157 *parent = inode_ref (itable->root);
158
159 saved_dir = alloca(strlen("/") + 1);
160 strcpy(saved_dir, "/");
>>> CID 1370938: Memory - corruptions (OVERRUN)
>>> Overrunning array "dir_stack" of 2048 8-byte elements at element index 2048 (byte offset 16384) using index "top" (which evaluates to 2048).
161 dir_stack[top] = saved_dir;
162 break;
163 } else {
164 snprintf (dir_handle, handle_size, "%s/%s/%02x/%02x/%s",
165 priv_base_path, GF_HIDDEN_PATH, tmp_gfid[0],
166 tmp_gfid[1], uuid_utoa (tmp_gfid));
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBK54bFWohdObZ6wlkeK264nDC24cnLwH4MTOSDXRjQcO27-2F6DmQXPB4g4Mz-2BEJJ0-3D_pIB5qNyu3krz5eLOmjwFZkKK-2FJ3CPgtiU1pdCCu-2BphdSOrEUWk0cFpclAo-2FrCqiJbOesEZFgcVk21mvZo-2FtKhVvWktKanKdxfjbHNsm7WECIMAGzqSBDi-2FwVtlM-2B9iQ1bgGqGYr-2BoXmKADAzywKM-2ByU-2B3Ezcx3OYxxt0W9veOXSwm9ceTwkLVh8iZh7U-2BphTJ-2BWN1MRfeTbqRqreYbmVYoWnpcb2AAgkXbMpsdMWDPU-3D
To manage Coverity Scan email notifications for "gluster-devel at gluster.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq48r9wNv8-2BLR0R-2BBlXm7ottYIbnE5UU-2F0Z00EseY5i5N2c1DtvQJ8Cp-2BSp5bYUPGR1MbiG-2F6KsJiGF2zIdiuCrkCwl5z0BqidHVuHFKKiyVZo-3D_pIB5qNyu3krz5eLOmjwFZkKK-2FJ3CPgtiU1pdCCu-2BphdSOrEUWk0cFpclAo-2FrCqiJbOesEZFgcVk21mvZo-2FtKhTzmls8tJcMLU5sKduJoKMivYTizp6hTTN4YLFylJv1LrDWro4d0Dk7MTNgEsTyPegLJiLPlxTeQsUBJ2fQYIaXgVgmB3-2FCktNzxuUe9rZI1Ebn4fOf8A9UuwyHMXCy7g7lS3svw5w1MqKFpLvpAr-2Bk-3D
More information about the Gluster-devel
mailing list