From f9ca9f09ce47715573d0ae2b5e174e8b63185b56 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 27 Apr 2012 16:19:38 +0530 Subject: storage/posix: Fix leak of dict in getxattr calls. get_new_dict does not take a ref. Ref was taken only when any data was added to the dict. But in the out tag: we call explicit unref, which would move the ref count to -1, if it was a unsuccessful call. unref destroys the dict only if ref == 0. Change-Id: Ie08c301237c2042daf90a7ef25569e3b06e3e1e9 BUG: 816870 Signed-off-by: shishir gowda Reviewed-on: http://review.gluster.com/3240 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 2f9b475a..b3bc6be7 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2474,8 +2474,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, } } - /* Get the total size */ - dict = get_new_dict (); + dict = dict_new (); if (!dict) { goto out; } @@ -2660,7 +2659,6 @@ done: if (dict) { dict_del (dict, GFID_XATTR_KEY); - dict_ref (dict); } out: -- cgit