From c913a6e6fcd9ebd962955ba5d51f518b2875eba3 Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Mon, 20 Nov 2017 10:51:09 +0100 Subject: features/locks: Fix memory leaks Change-Id: Ic1d2e17a7d14389b6734d1b88bd28c0a2907bbd6 BUG: 1515161 Signed-off-by: Xavier Hernandez --- xlators/features/locks/src/inodelk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/features/locks/src/inodelk.c') diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index a8381adda3d..64ffb00c18c 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -720,9 +720,6 @@ out: if (ctx) pthread_mutex_unlock (&ctx->lock); - if (need_inode_unref) - inode_unref (pl_inode->inode); - /* The following (extra) unref corresponds to the ref that * was done at the time the lock was granted. */ @@ -731,6 +728,10 @@ out: grant_blocked_inode_locks (this, pl_inode, dom); } + if (need_inode_unref) { + inode_unref (pl_inode->inode); + } + return ret; } -- cgit