From 06c1d6b2b87e542479e069132ee3cf9efa11384e Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 17 Jul 2012 13:44:32 +0530 Subject: storage/posix: use the size returned by getxattr to allocate memory Change-Id: I71c234b12a1d16405e508b715932022fdce346f0 BUG: 838195 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/3681 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/storage/posix/src/posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 371e8d4b..e2f1bbd5 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2660,7 +2660,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, break; } - value = GF_CALLOC (op_ret + 1, sizeof(char), + value = GF_CALLOC (size + 1, sizeof(char), gf_posix_mt_char); if (!value) { op_errno = errno; @@ -2844,7 +2844,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this, break; } - value = GF_CALLOC (op_ret + 1, sizeof(char), + value = GF_CALLOC (size + 1, sizeof(char), gf_posix_mt_char); if (!value) { op_ret = -1; -- cgit