summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
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/protocol
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/protocol')
-rw-r--r--xlators/protocol/auth/addr/src/addr.c3
-rw-r--r--xlators/protocol/auth/login/src/login.c3
-rw-r--r--xlators/protocol/client/src/client-handshake.c9
-rw-r--r--xlators/protocol/client/src/client-helpers.c4
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c412
-rw-r--r--xlators/protocol/client/src/client.c3
-rw-r--r--xlators/protocol/server/src/server-handshake.c14
-rw-r--r--xlators/protocol/server/src/server-helpers.c24
-rw-r--r--xlators/protocol/server/src/server-rpc-fops.c264
-rw-r--r--xlators/protocol/server/src/server.c9
10 files changed, 247 insertions, 498 deletions
diff --git a/xlators/protocol/auth/addr/src/addr.c b/xlators/protocol/auth/addr/src/addr.c
index 3551ec760c4..199fc6db00e 100644
--- a/xlators/protocol/auth/addr/src/addr.c
+++ b/xlators/protocol/auth/addr/src/addr.c
@@ -218,8 +218,7 @@ gf_auth (dict_t *input_params, dict_t *config_params)
}
out:
- if (addr_cpy)
- GF_FREE (addr_cpy);
+ GF_FREE (addr_cpy);
return result;
}
diff --git a/xlators/protocol/auth/login/src/login.c b/xlators/protocol/auth/login/src/login.c
index 838cb4262b6..702a876ac76 100644
--- a/xlators/protocol/auth/login/src/login.c
+++ b/xlators/protocol/auth/login/src/login.c
@@ -121,8 +121,7 @@ auth_result_t gf_auth (dict_t *input_params, dict_t *config_params)
}
out:
- if (username_cpy)
- GF_FREE (username_cpy);
+ GF_FREE (username_cpy);
return result;
}
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index f32fe171311..3242cf0aeb6 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -347,8 +347,7 @@ out:
rsp.spec);
/* Don't use 'GF_FREE', this is allocated by libc */
- if (rsp.spec)
- free (rsp.spec);
+ free (rsp.spec);
return 0;
}
@@ -1460,8 +1459,7 @@ out:
ret = 0;
}
- if (rsp.dict.dict_val)
- free (rsp.dict.dict_val);
+ free (rsp.dict.dict_val);
STACK_DESTROY (frame->root);
@@ -1582,8 +1580,7 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
(xdrproc_t)xdr_gf_setvolume_req);
fail:
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
return ret;
}
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
index a0a006123e1..77b416c476c 100644
--- a/xlators/protocol/client/src/client-helpers.c
+++ b/xlators/protocol/client/src/client-helpers.c
@@ -133,9 +133,7 @@ client_local_wipe (clnt_local_t *local)
iobref_unref (local->iobref);
}
- if (local->name) {
- GF_FREE (local->name);
- }
+ GF_FREE (local->name);
mem_put (local);
}
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index 66f93c73ba2..d541c35ebf3 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -193,8 +193,7 @@ out:
gf_error_to_errno (rsp.op_errno), inode, &stbuf,
&preparent, &postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -264,8 +263,7 @@ out:
gf_error_to_errno (rsp.op_errno), inode,
&stbuf, &preparent, &postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -333,8 +331,7 @@ out:
gf_error_to_errno (rsp.op_errno), inode,
&stbuf, &preparent, &postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -476,8 +473,7 @@ out:
CLIENT_STACK_UNWIND (open, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), fd, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -532,8 +528,7 @@ out:
CLIENT_STACK_UNWIND (stat, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), &iatt, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -590,11 +585,9 @@ out:
/* This is allocated by the libc while decoding RPC msg */
/* Hence no 'GF_FREE', but just 'free' */
- if (rsp.path)
- free (rsp.path);
+ free (rsp.path);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -650,8 +643,7 @@ out:
gf_error_to_errno (rsp.op_errno), &preparent,
&postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -707,8 +699,7 @@ out:
gf_error_to_errno (rsp.op_errno), &preparent,
&postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -765,8 +756,7 @@ out:
gf_error_to_errno (rsp.op_errno), &prestat,
&poststat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -820,8 +810,7 @@ out:
CLIENT_STACK_UNWIND (statfs, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), &statfs, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -879,8 +868,7 @@ out:
gf_error_to_errno (rsp.op_errno), &prestat,
&poststat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -938,8 +926,7 @@ out:
CLIENT_STACK_UNWIND (flush, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -996,8 +983,7 @@ out:
gf_error_to_errno (rsp.op_errno), &prestat,
&poststat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1048,8 +1034,7 @@ out:
}
CLIENT_STACK_UNWIND (setxattr, frame, rsp.op_ret, op_errno, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1117,11 +1102,9 @@ out:
CLIENT_STACK_UNWIND (getxattr, frame, rsp.op_ret, op_errno, dict, xdata);
/* don't use GF_FREE, this memory was allocated by libc */
- if (rsp.dict.dict_val)
- free (rsp.dict.dict_val);
+ free (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1185,11 +1168,9 @@ out:
CLIENT_STACK_UNWIND (fgetxattr, frame, rsp.op_ret, op_errno, dict, xdata);
- if (rsp.dict.dict_val)
- free (rsp.dict.dict_val);
+ free (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1241,8 +1222,7 @@ out:
CLIENT_STACK_UNWIND (removexattr, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1291,8 +1271,7 @@ out:
CLIENT_STACK_UNWIND (fremovexattr, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1340,8 +1319,7 @@ out:
CLIENT_STACK_UNWIND (fsyncdir, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1389,8 +1367,7 @@ out:
CLIENT_STACK_UNWIND (access, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1447,8 +1424,7 @@ out:
gf_error_to_errno (rsp.op_errno), &prestat,
&poststat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1501,8 +1477,7 @@ out:
CLIENT_STACK_UNWIND (fstat, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), &stat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1552,8 +1527,7 @@ out:
CLIENT_STACK_UNWIND (inodelk, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1602,8 +1576,7 @@ out:
CLIENT_STACK_UNWIND (finodelk, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1653,8 +1626,7 @@ out:
CLIENT_STACK_UNWIND (entrylk, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1704,8 +1676,7 @@ out:
CLIENT_STACK_UNWIND (fentrylk, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1770,11 +1741,9 @@ out:
CLIENT_STACK_UNWIND (xattrop, frame, rsp.op_ret,
gf_error_to_errno (op_errno), dict, xdata);
- if (rsp.dict.dict_val)
- free (rsp.dict.dict_val);
+ free (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1838,11 +1807,9 @@ out:
CLIENT_STACK_UNWIND (fxattrop, frame, rsp.op_ret,
gf_error_to_errno (op_errno), dict, xdata);
- if (rsp.dict.dict_val)
- free (rsp.dict.dict_val);
+ free (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1896,8 +1863,7 @@ out:
CLIENT_STACK_UNWIND (fsetxattr, frame, rsp.op_ret, op_errno, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -1953,8 +1919,7 @@ out:
gf_error_to_errno (rsp.op_errno), &prestat,
&poststat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2012,8 +1977,7 @@ out:
gf_error_to_errno (rsp.op_errno), &prestat,
&poststat, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2091,8 +2055,7 @@ out:
gf_error_to_errno (rsp.op_errno), fd, inode,
&stbuf, &preparent, &postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2151,8 +2114,7 @@ out:
free (rsp.strong_checksum.strong_checksum_val);
}
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2224,11 +2186,9 @@ out:
CLIENT_STACK_UNWIND (lk, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), &lock, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
- if (rsp.flock.lk_owner.lk_owner_val)
- free (rsp.flock.lk_owner.lk_owner_val);
+ free (rsp.flock.lk_owner.lk_owner_val);
if (xdata)
dict_unref (xdata);
@@ -2291,8 +2251,7 @@ out:
gf_dirent_free (&entries);
}
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2355,8 +2314,7 @@ out:
if (rsp.op_ret != -1) {
gf_dirent_free (&entries);
}
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2424,8 +2382,7 @@ out:
&stbuf, &preoldparent, &postoldparent,
&prenewparent, &postnewparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2496,8 +2453,7 @@ out:
gf_error_to_errno (rsp.op_errno), inode,
&stbuf, &preparent, &postparent, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2567,8 +2523,7 @@ out:
CLIENT_STACK_UNWIND (opendir, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), fd, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -2658,8 +2613,7 @@ out:
if (xdata)
dict_unref (xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
return 0;
}
@@ -2726,8 +2680,7 @@ out:
gf_error_to_errno (rsp.op_errno), vector, rspcount,
&stat, iobref, xdata);
- if (rsp.xdata.xdata_val)
- free (rsp.xdata.xdata_val);
+ free (rsp.xdata.xdata_val);
if (xdata)
dict_unref (xdata);
@@ -3012,8 +2965,7 @@ client3_3_lookup (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobref)
iobref_unref (rsp_iobref);
@@ -3027,8 +2979,7 @@ unwind:
CLIENT_STACK_UNWIND (lookup, frame, -1, op_errno, NULL, NULL, NULL,
NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobref)
iobref_unref (rsp_iobref);
@@ -3077,15 +3028,13 @@ client3_3_stat (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (stat, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3133,14 +3082,12 @@ client3_3_truncate (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (truncate, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3182,14 +3129,12 @@ client3_3_ftruncate (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (ftruncate, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3238,14 +3183,12 @@ client3_3_access (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (access, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3326,8 +3269,7 @@ client3_3_readlink (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
@@ -3336,8 +3278,7 @@ unwind:
}
CLIENT_STACK_UNWIND (readlink, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3386,14 +3327,12 @@ client3_3_unlink (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (unlink, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3440,14 +3379,12 @@ client3_3_rmdir (call_frame_t *frame, xlator_t *this,
if (ret) {
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (rmdir, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3508,8 +3445,7 @@ client3_3_symlink (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
@@ -3517,8 +3453,7 @@ unwind:
CLIENT_STACK_UNWIND (symlink, frame, -1, op_errno, NULL, NULL, NULL,
NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3575,16 +3510,14 @@ client3_3_rename (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (rename, frame, -1, op_errno, NULL, NULL, NULL,
NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3651,14 +3584,12 @@ client3_3_link (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3718,16 +3649,14 @@ client3_3_mknod (call_frame_t *frame, xlator_t *this,
if (ret) {
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (mknod, frame, -1, op_errno, NULL, NULL, NULL,
NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3787,16 +3716,14 @@ client3_3_mkdir (call_frame_t *frame, xlator_t *this,
if (ret) {
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (mkdir, frame, -1, op_errno, NULL, NULL, NULL,
NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3858,16 +3785,14 @@ client3_3_create (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (create, frame, -1, op_errno, NULL, NULL, NULL,
NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -3926,15 +3851,13 @@ client3_3_open (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (open, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4022,8 +3945,7 @@ client3_3_readv (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -4040,8 +3962,7 @@ unwind:
iobref_unref (rsp_iobref);
CLIENT_STACK_UNWIND (readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4097,15 +4018,13 @@ client3_3_writev (call_frame_t *frame, xlator_t *this, void *data)
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (writev, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4157,16 +4076,14 @@ client3_3_flush (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (flush, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4208,15 +4125,13 @@ client3_3_fsync (call_frame_t *frame, xlator_t *this,
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fsync, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4256,15 +4171,13 @@ client3_3_fstat (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fstat, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4321,16 +4234,14 @@ client3_3_opendir (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (opendir, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4373,15 +4284,13 @@ client3_3_fsyncdir (call_frame_t *frame, xlator_t *this, void *data)
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fsyncdir, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4431,15 +4340,13 @@ client3_3_statfs (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (statfs, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4493,20 +4400,16 @@ client3_3_setxattr (call_frame_t *frame, xlator_t *this,
if (ret) {
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (setxattr, frame, -1, op_errno, NULL);
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4554,20 +4457,16 @@ client3_3_fsetxattr (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fsetxattr, frame, -1, op_errno, NULL);
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4653,8 +4552,7 @@ client3_3_fgetxattr (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -4672,8 +4570,7 @@ unwind:
if (rsp_iobref)
iobref_unref (rsp_iobref);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4795,8 +4692,7 @@ client3_3_getxattr (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -4814,8 +4710,7 @@ unwind:
CLIENT_STACK_UNWIND (getxattr, frame, op_ret, op_errno, dict, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -4909,11 +4804,9 @@ client3_3_xattrop (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -4925,9 +4818,7 @@ client3_3_xattrop (call_frame_t *frame, xlator_t *this,
unwind:
CLIENT_STACK_UNWIND (xattrop, frame, -1, op_errno, NULL, NULL);
- if (req.dict.dict_val) {
- GF_FREE (req.dict.dict_val);
- }
+ GF_FREE (req.dict.dict_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -4935,8 +4826,7 @@ unwind:
if (rsp_iobref)
iobref_unref (rsp_iobref);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5022,11 +4912,9 @@ client3_3_fxattrop (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -5038,8 +4926,7 @@ client3_3_fxattrop (call_frame_t *frame, xlator_t *this,
unwind:
CLIENT_STACK_UNWIND (fxattrop, frame, -1, op_errno, NULL, NULL);
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
if (rsp_iobref)
iobref_unref (rsp_iobref);
@@ -5047,8 +4934,7 @@ unwind:
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5096,14 +4982,12 @@ client3_3_removexattr (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (removexattr, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5147,14 +5031,12 @@ client3_3_fremovexattr (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fremovexattr, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5229,14 +5111,12 @@ client3_3_lk (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (lk, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5313,14 +5193,12 @@ client3_3_inodelk (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (inodelk, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5391,13 +5269,11 @@ client3_3_finodelk (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (finodelk, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5452,14 +5328,12 @@ client3_3_entrylk (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (entrylk, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5508,14 +5382,12 @@ client3_3_fentrylk (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fentrylk, frame, -1, op_errno, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5557,14 +5429,12 @@ client3_3_rchecksum (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (rchecksum, frame, -1, op_errno, 0, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5656,8 +5526,7 @@ client3_3_readdir (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -5675,8 +5544,7 @@ unwind:
iobuf_unref (rsp_iobuf);
CLIENT_STACK_UNWIND (readdir, frame, -1, op_errno, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5768,8 +5636,7 @@ client3_3_readdirp (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
@@ -5785,8 +5652,7 @@ unwind:
if (rsp_iobuf)
iobuf_unref (rsp_iobuf);
- if (req.dict.dict_val)
- GF_FREE (req.dict.dict_val);
+ GF_FREE (req.dict.dict_val);
CLIENT_STACK_UNWIND (readdirp, frame, -1, op_errno, NULL, NULL);
return 0;
@@ -5836,14 +5702,12 @@ client3_3_setattr (call_frame_t *frame, xlator_t *this,
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (setattr, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
@@ -5882,14 +5746,12 @@ client3_3_fsetattr (call_frame_t *frame, xlator_t *this, void *data)
gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
}
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
unwind:
CLIENT_STACK_UNWIND (fsetattr, frame, -1, op_errno, NULL, NULL, NULL);
- if (req.xdata.xdata_val)
- GF_FREE (req.xdata.xdata_val);
+ GF_FREE (req.xdata.xdata_val);
return 0;
}
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 77111ec3445..16c7dee5ece 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -1269,8 +1269,7 @@ client_set_remote_options (char *value, xlator_t *this)
ret = _gf_true;
out:
- if (dup_value)
- GF_FREE (dup_value);
+ GF_FREE (dup_value);
return ret;
}
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index b429eb6b295..04662b403d7 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -669,19 +669,15 @@ fail:
(xdrproc_t)xdr_gf_setvolume_rsp);
- if (args.dict.dict_val)
- free (args.dict.dict_val);
+ free (args.dict.dict_val);
- if (rsp.dict.dict_val)
- GF_FREE (rsp.dict.dict_val);
+ GF_FREE (rsp.dict.dict_val);
dict_unref (params);
dict_unref (reply);
dict_unref (config_params);
- if (buf) {
- GF_FREE (buf);
- }
+ GF_FREE (buf);
return 0;
}
@@ -737,9 +733,7 @@ fail:
server_submit_reply (NULL, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_set_lk_ver_rsp);
- if (args.uid != NULL) {
- free (args.uid);
- }
+ free (args.uid);
return 0;
}
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 284b44145ec..3a7bb4aeae2 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -61,19 +61,16 @@ server_loc_wipe (loc_t *loc)
loc->inode = NULL;
}
- if (loc->path)
- GF_FREE ((void *)loc->path);
+ GF_FREE ((void *)loc->path);
}
void
server_resolve_wipe (server_resolve_t *resolve)
{
- if (resolve->path)
- GF_FREE ((void *)resolve->path);
+ GF_FREE ((void *)resolve->path);
- if (resolve->bname)
- GF_FREE ((void *)resolve->bname);
+ GF_FREE ((void *)resolve->bname);
loc_wipe (&resolve->resolve_loc);
}
@@ -121,11 +118,9 @@ free_state (server_state_t *state)
state->xdata = NULL;
}
- if (state->volume)
- GF_FREE ((void *)state->volume);
+ GF_FREE ((void *)state->volume);
- if (state->name)
- GF_FREE ((void *)state->name);
+ GF_FREE ((void *)state->name);
server_loc_wipe (&state->loc);
server_loc_wipe (&state->loc2);
@@ -528,8 +523,7 @@ do_connection_cleanup (xlator_t *this, server_connection_t *conn,
}
state = CALL_STATE (frame);
- if (state)
- GF_FREE (state);
+ GF_FREE (state);
STACK_DESTROY (frame->root);
@@ -1294,8 +1288,7 @@ serialize_rsp_direntp (gf_dirent_t *entries, gfs3_readdirp_rsp *rsp)
ret = 0;
out:
- if (trav)
- GF_FREE (trav);
+ GF_FREE (trav);
return ret;
}
@@ -1361,8 +1354,7 @@ readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp)
prev = trav;
while (trav) {
trav = trav->nextentry;
- if (prev->dict.dict_val)
- GF_FREE (prev->dict.dict_val);
+ GF_FREE (prev->dict.dict_val);
GF_FREE (prev);
prev = trav;
}
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
index 63f4bfeaaca..e7e5fce5395 100644
--- a/xlators/protocol/server/src/server-rpc-fops.c
+++ b/xlators/protocol/server/src/server-rpc-fops.c
@@ -65,8 +65,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_statfs_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -165,8 +164,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_lookup_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -223,8 +221,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_lk_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -274,8 +271,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -325,8 +321,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -375,8 +370,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -425,8 +419,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -462,8 +455,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -515,8 +507,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_rmdir_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -563,8 +554,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_mkdir_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -611,8 +601,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_mknod_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -647,8 +636,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -695,8 +683,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_readdir_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
readdir_rsp_cleanup (&rsp);
@@ -740,8 +727,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_opendir_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -776,8 +762,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -812,8 +797,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -854,11 +838,9 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_getxattr_rsp);
- if (rsp.dict.dict_val)
- GF_FREE (rsp.dict.dict_val);
+ GF_FREE (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -900,11 +882,9 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fgetxattr_rsp);
- if (rsp.dict.dict_val)
- GF_FREE (rsp.dict.dict_val);
+ GF_FREE (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -943,8 +923,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -984,8 +963,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1070,8 +1048,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_rename_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1125,8 +1102,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_unlink_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1173,8 +1149,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_symlink_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1225,8 +1200,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_link_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1264,8 +1238,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_truncate_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1302,8 +1275,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fstat_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1341,8 +1313,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_ftruncate_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1376,8 +1347,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gf_common_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1415,8 +1385,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fsync_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1454,8 +1423,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_write_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1505,8 +1473,7 @@ out:
server_submit_reply (frame, req, &rsp, vector, count, iobref,
(xdrproc_t)xdr_gfs3_read_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1547,8 +1514,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_rchecksum_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1591,8 +1557,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_open_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1677,8 +1642,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_create_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1720,8 +1684,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_readlink_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1759,8 +1722,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_stat_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1800,8 +1762,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_setattr_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1840,8 +1801,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fsetattr_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1881,11 +1841,9 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_xattrop_rsp);
- if (rsp.dict.dict_val)
- GF_FREE (rsp.dict.dict_val);
+ GF_FREE (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1925,11 +1883,9 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fxattrop_rsp);
- if (rsp.dict.dict_val)
- GF_FREE (rsp.dict.dict_val);
+ GF_FREE (rsp.dict.dict_val);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
return 0;
}
@@ -1979,8 +1935,7 @@ out:
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_readdirp_rsp);
- if (rsp.xdata.xdata_val)
- GF_FREE (rsp.xdata.xdata_val);
+ GF_FREE (rsp.xdata.xdata_val);
readdirp_rsp_cleanup (&rsp);
@@ -2985,8 +2940,7 @@ server3_3_stat (rpcsvc_request_t *req)
resolve_and_resume (frame, server_stat_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3046,8 +3000,7 @@ out:
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
return ret;
}
@@ -3101,8 +3054,7 @@ server3_3_fsetattr (rpcsvc_request_t *req)
resolve_and_resume (frame, server_fsetattr_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3158,8 +3110,7 @@ server3_3_readlink (rpcsvc_request_t *req)
resolve_and_resume (frame, server_readlink_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3227,8 +3178,7 @@ server3_3_create (rpcsvc_request_t *req)
out:
/* memory allocated by libc, don't use GF_FREE */
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3286,8 +3236,7 @@ out:
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
return ret;
}
@@ -3343,8 +3292,7 @@ server3_3_readv (rpcsvc_request_t *req)
resolve_and_resume (frame, server_readv_resume);
out:
/* memory allocated by libc, don't use GF_FREE */
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3425,8 +3373,7 @@ server3_3_writev (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_writev_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3483,8 +3430,7 @@ server3_3_writev_vecsizer (int state, ssize_t *readsize, char *base_addr,
else
nextstate = SERVER3_3_VECWRITE_READING_OPAQUE;
- if (write_req.xdata.xdata_val)
- free (write_req.xdata.xdata_val);
+ free (write_req.xdata.xdata_val);
break;
@@ -3606,8 +3552,7 @@ server3_3_fsync (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_fsync_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3662,8 +3607,7 @@ server3_3_flush (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_flush_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3719,8 +3663,7 @@ server3_3_ftruncate (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_ftruncate_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3774,8 +3717,7 @@ server3_3_fstat (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_fstat_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3829,8 +3771,7 @@ server3_3_truncate (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_truncate_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3889,8 +3830,7 @@ server3_3_unlink (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_unlink_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -3959,8 +3899,7 @@ server3_3_setxattr (rpcsvc_request_t *req)
return ret;
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4030,8 +3969,7 @@ server3_3_fsetxattr (rpcsvc_request_t *req)
return ret;
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4102,8 +4040,7 @@ server3_3_fxattrop (rpcsvc_request_t *req)
return ret;
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4173,8 +4110,7 @@ server3_3_xattrop (rpcsvc_request_t *req)
return ret;
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4238,8 +4174,7 @@ server3_3_getxattr (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_getxattr_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4297,8 +4232,7 @@ server3_3_fgetxattr (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_fgetxattr_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4355,8 +4289,7 @@ server3_3_removexattr (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_removexattr_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4413,8 +4346,7 @@ server3_3_fremovexattr (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_fremovexattr_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4469,8 +4401,7 @@ server3_3_opendir (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_opendir_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4542,8 +4473,7 @@ out:
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
- if (args.dict.dict_val)
- free (args.dict.dict_val);
+ free (args.dict.dict_val);
return ret;
}
@@ -4606,8 +4536,7 @@ server3_3_readdir (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_readdir_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4661,8 +4590,7 @@ server3_3_fsyncdir (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_fsyncdir_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4728,8 +4656,7 @@ out:
req->rpc_err = GARBAGE_ARGS;
/* memory allocated by libc, don't use GF_FREE */
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
return ret;
@@ -4791,8 +4718,7 @@ out:
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
return ret;
}
@@ -4847,8 +4773,7 @@ server3_3_rmdir (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_rmdir_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4935,11 +4860,9 @@ server3_3_inodelk (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_inodelk_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
- if (args.flock.lk_owner.lk_owner_val)
- free (args.flock.lk_owner.lk_owner_val);
+ free (args.flock.lk_owner.lk_owner_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5023,11 +4946,9 @@ server3_3_finodelk (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_finodelk_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
- if (args.flock.lk_owner.lk_owner_val)
- free (args.flock.lk_owner.lk_owner_val);
+ free (args.flock.lk_owner.lk_owner_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5090,8 +5011,7 @@ server3_3_entrylk (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_entrylk_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5153,8 +5073,7 @@ server3_3_fentrylk (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_fentrylk_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5207,8 +5126,7 @@ server3_3_access (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_access_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5273,8 +5191,7 @@ out:
req->rpc_err = GARBAGE_ARGS;
/* memory allocated by libc, don't use GF_FREE */
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
return ret;
}
@@ -5331,8 +5248,7 @@ server3_3_link (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_link_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5393,8 +5309,7 @@ server3_3_rename (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_rename_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5495,11 +5410,9 @@ server3_3_lk (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_lk_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
- if (args.flock.lk_owner.lk_owner_val)
- free (args.flock.lk_owner.lk_owner_val);
+ free (args.flock.lk_owner.lk_owner_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5554,8 +5467,7 @@ server3_3_rchecksum (rpcsvc_request_t *req)
ret = 0;
resolve_and_resume (frame, server_rchecksum_resume);
out:
- if (args.xdata.xdata_val)
- free (args.xdata.xdata_val);
+ free (args.xdata.xdata_val);
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index b7612e01258..74dbc17e6af 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -619,8 +619,7 @@ validate_auth_options (xlator_t *this, dict_t *dict)
}
out:
- if (tmp_addr_list)
- GF_FREE (tmp_addr_list);
+ GF_FREE (tmp_addr_list);
return error;
}
@@ -865,8 +864,7 @@ reconfigure (xlator_t *this, dict_t *options)
/*ret = dict_get_str (options, "statedump-path", &statedump_path);
if (!ret) {
gf_path_strip_trailing_slashes (statedump_path);
- if (this->ctx->statedump_path)
- GF_FREE (this->ctx->statedump_path);
+ GF_FREE (this->ctx->statedump_path);
this->ctx->statedump_path = gf_strdup (statedump_path);
}*/
GF_OPTION_RECONF ("statedump-path", statedump_path,
@@ -878,8 +876,7 @@ reconfigure (xlator_t *this, dict_t *options)
goto out;
}
gf_path_strip_trailing_slashes (statedump_path);
- if (this->ctx->statedump_path)
- GF_FREE (this->ctx->statedump_path);
+ GF_FREE (this->ctx->statedump_path);
this->ctx->statedump_path = gf_strdup (statedump_path);
if (!conf->auth_modules)