diff options
author | Jim Meyering <meyering@redhat.com> | 2012-07-13 10:29:48 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-13 14:03:42 -0700 |
commit | 7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 (patch) | |
tree | 5a383d85eb18399cf7506a90cc7627c749ccf9b8 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c | |
parent | 2dc0d32e5d8b205fa407073b209bb663d546dde8 (diff) |
remove useless if-before-free (and free-like) functions
See comments in http://bugzilla.redhat.com/839925 for
the code to perform this change.
Signed-off-by: Jim Meyering <meyering@redhat.com>
BUG: 839925
Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a
Reviewed-on: http://review.gluster.com/3661
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 0bbadad3d10..f706ac67436 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -234,8 +234,7 @@ out: ret = 0; //Client response sent, prevent second response } - if (free_ptr) - GF_FREE(free_ptr); + GF_FREE(free_ptr); glusterd_volume_brickinfos_delete (&tmpvolinfo); if (brickinfo) @@ -299,8 +298,7 @@ glusterd_handle_cli_start_volume (rpcsvc_request_t *req) out: if (ret && dict) dict_unref (dict); - if (cli_req.dict.dict_val) - free (cli_req.dict.dict_val); //its malloced by xdr + free (cli_req.dict.dict_val); //its malloced by xdr glusterd_friend_sm (); glusterd_op_sm (); @@ -362,8 +360,7 @@ glusterd_handle_cli_stop_volume (rpcsvc_request_t *req) ((ret)?"FAILED":"SUCCESS")); out: - if (cli_req.dict.dict_val) - free (cli_req.dict.dict_val); //its malloced by xdr + free (cli_req.dict.dict_val); //its malloced by xdr glusterd_friend_sm (); glusterd_op_sm (); @@ -429,8 +426,7 @@ glusterd_handle_cli_delete_volume (rpcsvc_request_t *req) ((ret) ? "FAILED" : "SUCCESS")); out: - if (cli_req.dict.dict_val) - free (cli_req.dict.dict_val); //its malloced by xdr + free (cli_req.dict.dict_val); //its malloced by xdr if (ret && dict) dict_unref (dict); @@ -594,8 +590,7 @@ glusterd_handle_cli_statedump_volume (rpcsvc_request_t *req) out: if (ret && dict) dict_unref (dict); - if (cli_req.dict.dict_val) - free (cli_req.dict.dict_val); + free (cli_req.dict.dict_val); glusterd_friend_sm (); glusterd_op_sm(); @@ -731,8 +726,7 @@ glusterd_op_stage_create_volume (dict_t *dict, char **op_errstr) brick_info = NULL; } out: - if (free_ptr) - GF_FREE (free_ptr); + GF_FREE (free_ptr); if (brick_info) glusterd_brickinfo_delete (brick_info); gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); @@ -1437,8 +1431,7 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr) list_add_tail (&volinfo->vol_list, &priv->volumes); vol_added = _gf_true; out: - if (free_ptr) - GF_FREE(free_ptr); + GF_FREE(free_ptr); if (!vol_added && volinfo) glusterd_volinfo_delete (volinfo); return ret; @@ -1932,11 +1925,9 @@ out: GF_FREE (xl_opts); } - if (cmd_str) - GF_FREE (cmd_str); + GF_FREE (cmd_str); - if (mntpt) - GF_FREE (mntpt); + GF_FREE (mntpt); return ret; } |