summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-07-13 10:29:48 +0200
committerAnand Avati <avati@redhat.com>2012-07-13 14:03:42 -0700
commit7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 (patch)
tree5a383d85eb18399cf7506a90cc7627c749ccf9b8 /xlators/mgmt/glusterd/src/glusterd-brick-ops.c
parent2dc0d32e5d8b205fa407073b209bb663d546dde8 (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-brick-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index a0e24b434..640b8cb0d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -552,8 +552,7 @@ out:
glusterd_friend_sm ();
glusterd_op_sm ();
- 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
return ret;
}
@@ -850,10 +849,8 @@ out:
ret = 0; //sent error to cli, prevent second reply
}
- if (brick_list)
- GF_FREE (brick_list);
- if (cli_req.dict.dict_val)
- free (cli_req.dict.dict_val); //its malloced by xdr
+ GF_FREE (brick_list);
+ free (cli_req.dict.dict_val); //its malloced by xdr
glusterd_friend_sm ();
glusterd_op_sm ();
@@ -972,10 +969,8 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count,
}
out:
- if (free_ptr1)
- GF_FREE (free_ptr1);
- if (free_ptr2)
- GF_FREE (free_ptr2);
+ GF_FREE (free_ptr1);
+ GF_FREE (free_ptr2);
gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
@@ -1033,8 +1028,7 @@ glusterd_op_perform_remove_brick (glusterd_volinfo_t *volinfo, char *brick,
brickinfo->decommissioned = 1;
out:
- if (dup_brick)
- GF_FREE (dup_brick);
+ GF_FREE (dup_brick);
gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
@@ -1182,14 +1176,11 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr)
}
out:
- if (free_ptr)
- GF_FREE (free_ptr);
+ GF_FREE (free_ptr);
if (brick_alloc && brickinfo)
glusterd_brickinfo_delete (brickinfo);
- if (str_ret)
- GF_FREE (str_ret);
- if (all_bricks)
- GF_FREE (all_bricks);
+ GF_FREE (str_ret);
+ GF_FREE (all_bricks);
gf_log (THIS->name, GF_LOG_DEBUG, "Returning %d", ret);