summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-transport.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 /rpc/rpc-lib/src/rpc-transport.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 'rpc/rpc-lib/src/rpc-transport.c')
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index 4b693742449..6d06f0fb0fa 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);
}