summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r--rpc/rpc-lib/src/auth-glusterfs.c6
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c3
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c22
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c24
4 files changed, 18 insertions, 37 deletions
diff --git a/rpc/rpc-lib/src/auth-glusterfs.c b/rpc/rpc-lib/src/auth-glusterfs.c
index 5f41c8296..c08871466 100644
--- a/rpc/rpc-lib/src/auth-glusterfs.c
+++ b/rpc/rpc-lib/src/auth-glusterfs.c
@@ -213,10 +213,8 @@ int auth_glusterfs_v2_authenticate (rpcsvc_request_t *req, void *priv)
ret = RPCSVC_AUTH_ACCEPT;
err:
/* TODO: instead use alloca() for these variables */
- if (au.groups.groups_val)
- free (au.groups.groups_val);
- if (au.lk_owner.lk_owner_val)
- free (au.lk_owner.lk_owner_val);
+ free (au.groups.groups_val);
+ free (au.lk_owner.lk_owner_val);
return ret;
}
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 9a65f09c0..f099fb6b5 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -1721,8 +1721,7 @@ rpc_clnt_transport_unix_options_build (dict_t **options, char *filepath)
*options = dict;
out:
if (ret) {
- if (fpath)
- GF_FREE (fpath);
+ GF_FREE (fpath);
if (dict)
dict_unref (dict);
}
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index 4b6937424..6d06f0fb0 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -322,19 +322,15 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name)
return_trans = trans;
- if (name)
- GF_FREE (name);
+ GF_FREE (name);
- if (vol_opt)
- GF_FREE (vol_opt);
+ GF_FREE (vol_opt);
return return_trans;
fail:
if (trans) {
- if (trans->name) {
- GF_FREE (trans->name);
- }
+ GF_FREE (trans->name);
if (trans->dl_handle)
dlclose (trans->dl_handle);
@@ -342,11 +338,9 @@ fail:
GF_FREE (trans);
}
- if (name)
- GF_FREE (name);
+ GF_FREE (name);
- if (vol_opt)
- GF_FREE (vol_opt);
+ GF_FREE (vol_opt);
return NULL;
}
@@ -433,8 +427,7 @@ rpc_transport_destroy (rpc_transport_t *this)
pthread_mutex_destroy (&this->lock);
- if (this->name)
- GF_FREE (this->name);
+ GF_FREE (this->name);
if (this->dl_handle)
dlclose (this->dl_handle);
@@ -615,8 +608,7 @@ rpc_transport_inet_options_build (dict_t **options, const char *hostname,
*options = dict;
out:
if (ret) {
- if (host)
- GF_FREE (host);
+ GF_FREE (host);
if (dict)
dict_unref (dict);
}
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index ee9e1c725..634123426 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -1514,17 +1514,13 @@ rpcsvc_create_listeners (rpcsvc_t *svc, dict_t *options, char *name)
transport_type = NULL;
out:
- if (str)
- GF_FREE (str);
+ GF_FREE (str);
- if (transport_type)
- GF_FREE (transport_type);
+ GF_FREE (transport_type);
- if (tmp)
- GF_FREE (tmp);
+ GF_FREE (tmp);
- if (transport_name)
- GF_FREE (transport_name);
+ GF_FREE (transport_name);
return count;
}
@@ -1812,8 +1808,7 @@ rpcsvc_transport_unix_options_build (dict_t **options, char *filepath)
*options = dict;
out:
if (ret) {
- if (fpath)
- GF_FREE (fpath);
+ GF_FREE (fpath);
if (dict)
dict_unref (dict);
}
@@ -1935,8 +1930,7 @@ rpcsvc_transport_peer_check_search (dict_t *options, char *pattern, char *clstr)
ret = -1;
err:
- if (dup_addrstr)
- GF_FREE (dup_addrstr);
+ GF_FREE (dup_addrstr);
return ret;
}
@@ -2399,8 +2393,7 @@ rpcsvc_transport_privport_check (rpcsvc_t *svc, char *volname,
" allowed");
err:
- if (srchstr)
- GF_FREE (srchstr);
+ GF_FREE (srchstr);
return ret;
}
@@ -2429,8 +2422,7 @@ rpcsvc_volume_allowed (dict_t *options, char *volname)
ret = dict_get_str (options, srchstr, &addrstr);
out:
- if (srchstr)
- GF_FREE (srchstr);
+ GF_FREE (srchstr);
return addrstr;
}