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 /xlators/features/locks/src/entrylk.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 'xlators/features/locks/src/entrylk.c')
-rw-r--r-- | xlators/features/locks/src/entrylk.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index 2a47657db..2c4904ff3 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -341,8 +341,7 @@ __lock_name (pl_inode_t *pinode, const char *basename, entrylk_type type, if (conf) { ret = -EAGAIN; if (nonblock){ - if (lock->basename) - GF_FREE ((char *)lock->basename); + GF_FREE ((char *)lock->basename); GF_FREE (lock); goto out; @@ -361,8 +360,7 @@ __lock_name (pl_inode_t *pinode, const char *basename, entrylk_type type, if ( __blocked_lock_conflict (dom, basename, type) && !(__owner_has_lock (dom, lock))) { ret = -EAGAIN; if (nonblock) { - if (lock->basename) - GF_FREE ((char *) lock->basename); + GF_FREE ((char *) lock->basename); GF_FREE (lock); goto out; @@ -499,8 +497,7 @@ __grant_blocked_entry_locks (xlator_t *this, pl_inode_t *pl_inode, } else { gf_log (this->name, GF_LOG_DEBUG, "should never happen"); - if (bl->basename) - GF_FREE ((char *)bl->basename); + GF_FREE ((char *)bl->basename); GF_FREE (bl); } } @@ -601,8 +598,7 @@ release_entry_locks_for_transport (xlator_t *this, pl_inode_t *pinode, STACK_UNWIND_STRICT (entrylk, lock->frame, -1, EAGAIN, NULL); - if (lock->basename) - GF_FREE ((char *)lock->basename); + GF_FREE ((char *)lock->basename); GF_FREE (lock); } @@ -612,8 +608,7 @@ release_entry_locks_for_transport (xlator_t *this, pl_inode_t *pinode, STACK_UNWIND_STRICT (entrylk, lock->frame, 0, 0, NULL); - if (lock->basename) - GF_FREE ((char *)lock->basename); + GF_FREE ((char *)lock->basename); GF_FREE (lock); } |