From 918678dc8e5a8cac1ec2dea7f8d2b11a186f38eb Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Thu, 12 Apr 2012 15:46:37 -0400 Subject: md-cache: fix dict memory leak in mdc_inode_xatt_update We currently either dict_ref() or dict_copy() into mdc->xattr. The double dict_ref() call path is obvious. Alternatively, dict_copy() does not ref the dict in the situation where it creates a new dict, but we only call dict_copy() in this context when we already have a dict, which should mean the extra ref is unnecessary. BUG: 801582 Change-Id: I72e3f1a16f942f04752c033812d13d50ee7c2c2c Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.com/3138 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/performance/md-cache/src/md-cache.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index dd161ce84bb..9ef599ad8ba 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -491,8 +491,6 @@ mdc_inode_xatt_update (xlator_t *this, inode_t *inode, dict_t *dict) else dict_copy (dict, mdc->xattr); - mdc->xattr = dict_ref (dict); - time (&mdc->xa_time); } UNLOCK (&mdc->lock); -- cgit