summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-02-22 13:46:37 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-22 03:26:24 -0800
commit2b52b096a7db3124fdd97554e63792f36e889af9 (patch)
treea0f7d42ec9651802dc0770c0df9dae9bacb2513a /xlators
parentf3b2305009b98de42c84e5b86668cf8b5f41e01f (diff)
features/locks: Don't access free'd memory
Change-Id: I4e22ede84622f2c9c46cc0bc9f17bef73afa815c BUG: 796069 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2791 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/locks/src/inodelk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index 5785f1f8e3f..cc716033047 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -421,9 +421,6 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
if (l->transport != trans)
continue;
- __delete_inode_lock (l);
- __destroy_inode_lock (l);
-
inode_path (inode, NULL, &path);
if (path)
file = path;
@@ -435,10 +432,14 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
"{transport=%p, pid=%"PRId64" lk-owner=%s}",
file, trans, (uint64_t) l->client_pid,
lkowner_utoa (&l->owner));
+
if (path) {
GF_FREE (path);
path = NULL;
}
+
+ __delete_inode_lock (l);
+ __destroy_inode_lock (l);
}
}
if (path)