From 2b52b096a7db3124fdd97554e63792f36e889af9 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 22 Feb 2012 13:46:37 +0530 Subject: features/locks: Don't access free'd memory Change-Id: I4e22ede84622f2c9c46cc0bc9f17bef73afa815c BUG: 796069 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2791 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/locks/src/inodelk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/features') 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) -- cgit