diff options
author | Jim Meyering <meyering@redhat.com> | 2012-07-13 10:29:48 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-13 14:03:42 -0700 |
commit | 7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 (patch) | |
tree | 5a383d85eb18399cf7506a90cc7627c749ccf9b8 /rpc/rpc-lib/src/rpcsvc.c | |
parent | 2dc0d32e5d8b205fa407073b209bb663d546dde8 (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/rpcsvc.c')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index ee9e1c72507..63412342689 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; } |