summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/reservelk.c
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2017-03-09 09:29:49 +0100
committerJeff Darcy <jdarcy@redhat.com>2017-03-11 19:52:12 -0500
commitb3ac24cdd759fb4cd2946329860bcc004f736b23 (patch)
treea13a73470fedc5be257aca76f9ff6306096d5392 /xlators/features/locks/src/reservelk.c
parentb9e1c911833ca1916055622e5265672d5935d925 (diff)
features/locks: Fix leak of posix_lock_t's client_uid
Change-Id: I3bc14998ed6a8841f77a004c24a456331048a521 BUG: 1428510 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: https://review.gluster.org/16838 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@gmail.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/reservelk.c')
-rw-r--r--xlators/features/locks/src/reservelk.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/xlators/features/locks/src/reservelk.c b/xlators/features/locks/src/reservelk.c
index 8eb08d0ef79..13b23f9f887 100644
--- a/xlators/features/locks/src/reservelk.c
+++ b/xlators/features/locks/src/reservelk.c
@@ -18,18 +18,6 @@
#include "locks.h"
#include "common.h"
-void
-__delete_reserve_lock (posix_lock_t *lock)
-{
- list_del (&lock->list);
-}
-
-void
-__destroy_reserve_lock (posix_lock_t *lock)
-{
- GF_FREE (lock);
-}
-
/* Return true if the two reservelks have exactly same lock boundaries */
int
reservelks_equal (posix_lock_t *l1, posix_lock_t *l2)
@@ -110,7 +98,7 @@ __reservelk_conflict (xlator_t *this, pl_inode_t *pl_inode,
list_del_init (&conf->list);
gf_log (this->name, GF_LOG_TRACE,
"Removing the matching reservelk for setlk to progress");
- GF_FREE (conf);
+ __destroy_lock(conf);
ret = 0;
} else {
gf_log (this->name, GF_LOG_TRACE,
@@ -217,7 +205,7 @@ __reserve_unlock_lock (xlator_t *this, posix_lock_t *lock, pl_inode_t *pl_inode)
" Matching lock not found for unlock");
goto out;
}
- __delete_reserve_lock (conf);
+ __delete_lock(conf);
gf_log (this->name, GF_LOG_DEBUG,
" Matching lock found for unlock");
@@ -392,7 +380,7 @@ pl_reserve_unlock (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock)
gf_log (this->name, GF_LOG_TRACE,
"Reservelk Unlock successful");
- __destroy_reserve_lock (retlock);
+ __destroy_lock(retlock);
ret = 0;
}
out: