summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2012-07-17 13:44:32 +0530
committerAnand Avati <avati@redhat.com>2012-07-17 13:59:48 -0700
commit06c1d6b2b87e542479e069132ee3cf9efa11384e (patch)
tree2f25126da78f5a04f387180e80c3359494df06d5 /xlators
parentaea7759f1240b1e97684273b9369472695173a66 (diff)
storage/posix: use the size returned by getxattr to allocate memory
Change-Id: I71c234b12a1d16405e508b715932022fdce346f0 BUG: 838195 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3681 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/storage/posix/src/posix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 371e8d4bc6d..e2f1bbd5f97 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;