summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2012-04-27 16:19:38 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-27 10:50:56 -0700
commitf9ca9f09ce47715573d0ae2b5e174e8b63185b56 (patch)
tree6cd64056e0bc4d2e7604ecbff0b91f7f6ea01b20 /xlators/storage
parentc3a16c32f5bd1924766d5844c100d5aa6ce8c392 (diff)
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 <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3240 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 2f9b475abc1..b3bc6be7f31 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: