From 703dbf354d53fdcc37851bb71420730675a7e170 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Mon, 6 Sep 2010 01:36:57 +0000 Subject: Leak in Locks Signed-off-by: Kaushik BV Signed-off-by: Vijay Bellur BUG: 996 (leak in locks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=996 --- xlators/features/locks/src/entrylk.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'xlators/features/locks') 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; -- cgit