summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/locks/src/entrylk.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c
index 6a0f81ec3f3..1e941e600d7 100644
--- a/xlators/features/locks/src/entrylk.c
+++ b/xlators/features/locks/src/entrylk.c
@@ -341,8 +341,13 @@ __lock_name (pl_inode_t *pinode, const char *basename, entrylk_type type,
conf = __lock_grantable (dom, basename, type);
if (conf) {
ret = -EAGAIN;
- if (nonblock)
- goto out;
+ if (nonblock){
+ if (lock->basename)
+ GF_FREE ((char *)lock->basename);
+ GF_FREE (lock);
+ goto out;
+
+ }
list_add_tail (&lock->blocked_locks, &dom->blocked_entrylks);
@@ -355,8 +360,13 @@ __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 (nonblock) {
+ if (lock->basename)
+ GF_FREE ((char *) lock->basename);
+ GF_FREE (lock);
goto out;
+
+ }
lock->frame = frame;
lock->this = this;