summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/call-stub.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 /libglusterfs/src/call-stub.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 'libglusterfs/src/call-stub.c')
-rw-r--r--libglusterfs/src/call-stub.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 85a1aaa7b5c..0ca5bf7f1e4 100644
--- a/libglusterfs/src/call-stub.c
+++ b/libglusterfs/src/call-stub.c
@@ -3712,8 +3712,7 @@ call_stub_destroy_wind (call_stub_t *stub)
case GF_FOP_GETXATTR:
{
- if (stub->args.getxattr.name)
- GF_FREE ((char *)stub->args.getxattr.name);
+ GF_FREE ((char *)stub->args.getxattr.name);
loc_wipe (&stub->args.getxattr.loc);
break;
}
@@ -3728,8 +3727,7 @@ call_stub_destroy_wind (call_stub_t *stub)
case GF_FOP_FGETXATTR:
{
- if (stub->args.fgetxattr.name)
- GF_FREE ((char *)stub->args.fgetxattr.name);
+ GF_FREE ((char *)stub->args.fgetxattr.name);
fd_unref (stub->args.fgetxattr.fd);
break;
}
@@ -3792,16 +3790,14 @@ call_stub_destroy_wind (call_stub_t *stub)
case GF_FOP_INODELK:
{
- if (stub->args.inodelk.volume)
- GF_FREE ((char *)stub->args.inodelk.volume);
+ GF_FREE ((char *)stub->args.inodelk.volume);
loc_wipe (&stub->args.inodelk.loc);
break;
}
case GF_FOP_FINODELK:
{
- if (stub->args.finodelk.volume)
- GF_FREE ((char *)stub->args.finodelk.volume);
+ GF_FREE ((char *)stub->args.finodelk.volume);
if (stub->args.finodelk.fd)
fd_unref (stub->args.finodelk.fd);
@@ -3809,21 +3805,17 @@ call_stub_destroy_wind (call_stub_t *stub)
}
case GF_FOP_ENTRYLK:
{
- if (stub->args.entrylk.volume)
- GF_FREE ((char *)stub->args.entrylk.volume);
+ GF_FREE ((char *)stub->args.entrylk.volume);
- if (stub->args.entrylk.name)
- GF_FREE ((char *)stub->args.entrylk.name);
+ GF_FREE ((char *)stub->args.entrylk.name);
loc_wipe (&stub->args.entrylk.loc);
break;
}
case GF_FOP_FENTRYLK:
{
- if (stub->args.fentrylk.volume)
- GF_FREE ((char *)stub->args.fentrylk.volume);
+ GF_FREE ((char *)stub->args.fentrylk.volume);
- if (stub->args.fentrylk.name)
- GF_FREE ((char *)stub->args.fentrylk.name);
+ GF_FREE ((char *)stub->args.fentrylk.name);
if (stub->args.fentrylk.fd)
fd_unref (stub->args.fentrylk.fd);
@@ -3922,8 +3914,7 @@ call_stub_destroy_unwind (call_stub_t *stub)
case GF_FOP_READLINK:
{
- if (stub->args.readlink_cbk.buf)
- GF_FREE ((char *)stub->args.readlink_cbk.buf);
+ GF_FREE ((char *)stub->args.readlink_cbk.buf);
}
break;