From 7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 13 Jul 2012 10:29:48 +0200 Subject: 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 BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- rpc/rpc-lib/src/rpc-transport.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'rpc/rpc-lib/src/rpc-transport.c') 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); } -- cgit