diff options
author | Xavier Hernandez <jahernan@redhat.com> | 2017-11-20 10:51:09 +0100 |
---|---|---|
committer | jiffin tony Thottan <jthottan@redhat.com> | 2017-11-30 06:42:25 +0000 |
commit | 29b633ad5d3cd97951679e47651f552f0a96dc5d (patch) | |
tree | a991877a0cad1e42e697b3b429505579ae8293fd /xlators/features/locks/src/inodelk.c | |
parent | 7ac43caefd1a723042362f49b18f6ba0d1b86d0f (diff) |
features/locks: Fix memory leaks
Backport of:
> BUG: 1515161
Change-Id: Ic1d2e17a7d14389b6734d1b88bd28c0a2907bbd6
BUG: 1517689
Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/inodelk.c')
-rw-r--r-- | xlators/features/locks/src/inodelk.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index e1702c78ba1..4aebac64fae 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -721,9 +721,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. */ @@ -732,6 +729,10 @@ out: grant_blocked_inode_locks (this, pl_inode, dom); } + if (need_inode_unref) { + inode_unref (pl_inode->inode); + } + return ret; } |