diff options
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 5 | ||||
-rw-r--r-- | cli/src/cli-cmd-volume.c | 4 | ||||
-rw-r--r-- | cli/src/cli.c | 5 | ||||
-rw-r--r-- | cli/src/cli3_1-cops.c | 42 |
4 files changed, 50 insertions, 6 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 1381e0fecef..e7ebd2a3696 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -285,6 +285,9 @@ out: if (trans_type) GF_FREE (trans_type); + if (tmp_list) + free (tmp_list); + return ret; } @@ -585,6 +588,8 @@ out: if (dict) dict_destroy (dict); } + if (tmp_list) + free (tmp_list); return ret; } diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 8fb32f5de47..c2b819e68d9 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -629,6 +629,8 @@ out: cli_out ("Adding brick to Volume %s failed",volname ); } } + if (options) + dict_unref (options); return ret; } @@ -685,6 +687,8 @@ out: cli_out ("Removing brick from Volume %s failed",volname ); } } + if (options) + dict_unref (options); return ret; } diff --git a/cli/src/cli.c b/cli/src/cli.c index 5e389b6c67f..97be0c5e1f6 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -319,12 +319,11 @@ cli_submit_request (void *req, call_frame_t *frame, pthread_mutex_unlock (&global_rpc->conn.lock); } - if (start_ping) - //client_start_ping ((void *) this); - ret = 0; out: + if (new_iobref) + iobref_unref (iobref); return ret; } diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c index 7e885a010f6..b2adb018826 100644 --- a/cli/src/cli3_1-cops.c +++ b/cli/src/cli3_1-cops.c @@ -592,14 +592,15 @@ gf_cli3_1_create_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + local = ((call_frame_t *) (myframe))->local; + ((call_frame_t *) (myframe))->local = NULL; + ret = gf_xdr_to_cli_create_vol_rsp (*iov, &rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; } - local = ((call_frame_t *) (myframe))->local; - dict = local->u.create_vol.dict; ret = dict_get_str (dict, "volname", &volname); @@ -614,6 +615,14 @@ gf_cli3_1_create_volume_cbk (struct rpc_req *req, struct iovec *iov, out: cli_cmd_broadcast_response (ret); + if (dict) + dict_unref (dict); + if (local) + cli_local_wipe (local); + if (rsp.volname) + free (rsp.volname); + if (rsp.op_errstr) + free (rsp.op_errstr); return ret; } @@ -639,6 +648,7 @@ gf_cli3_1_delete_volume_cbk (struct rpc_req *req, struct iovec *iov, frame = myframe; local = frame->local; + frame->local = NULL; if (local) volname = local->u.delete_vol.volname; @@ -652,6 +662,9 @@ gf_cli3_1_delete_volume_cbk (struct rpc_req *req, struct iovec *iov, out: cli_cmd_broadcast_response (ret); + cli_local_wipe (local); + if (rsp.volname) + free (rsp.volname); gf_log ("", GF_LOG_NORMAL, "Returning with %d", ret); return ret; } @@ -678,8 +691,10 @@ gf_cli3_1_start_volume_cbk (struct rpc_req *req, struct iovec *iov, frame = myframe; - if (frame) + if (frame) { local = frame->local; + frame->local = NULL; + } if (local) volname = local->u.start_vol.volname; @@ -695,6 +710,12 @@ gf_cli3_1_start_volume_cbk (struct rpc_req *req, struct iovec *iov, out: cli_cmd_broadcast_response (ret); + if (local) + cli_local_wipe (local); + if (rsp.volname) + free (rsp.volname); + if (rsp.op_errstr) + free (rsp.op_errstr); return ret; } @@ -737,6 +758,10 @@ gf_cli3_1_stop_volume_cbk (struct rpc_req *req, struct iovec *iov, out: cli_cmd_broadcast_response (ret); + if (rsp.op_errstr) + free (rsp.op_errstr); + if (rsp.volname) + free (rsp.volname); return ret; } @@ -989,6 +1014,10 @@ gf_cli3_1_add_brick_cbk (struct rpc_req *req, struct iovec *iov, out: cli_cmd_broadcast_response (ret); + if (rsp.volname) + free (rsp.volname); + if (rsp.op_errstr) + free (rsp.op_errstr); return ret; } @@ -1020,6 +1049,10 @@ gf_cli3_1_remove_brick_cbk (struct rpc_req *req, struct iovec *iov, out: cli_cmd_broadcast_response (ret); + if (rsp.volname) + free (rsp.volname); + if (rsp.op_errstr) + free (rsp.op_errstr); return ret; } @@ -1559,6 +1592,9 @@ gf_cli3_1_create_volume (call_frame_t *frame, xlator_t *this, out: gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret); + if (dict) + dict_unref (dict); + if (req.bricks.bricks_val) { GF_FREE (req.bricks.bricks_val); } |