summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2015-03-06 13:26:30 +0530
committerVijay Bellur <vbellur@redhat.com>2015-04-10 10:49:23 +0000
commitda2f8d09de5da89e544a0d56a1b46c234d3ecb5b (patch)
tree49dc8b37d1a6bab8f984d3c6e37f031bbf9412f3
parentaccd61fb64b96c4af47aa6cfa41adb0f2e47a60a (diff)
cluster/ec: Fix iobuf mem leak
iobuf_get and iobref_add implicitly ref the iobuf. Hence, it is necessary to unref iobuf before setting it to NULL. Change-Id: Icadd8925574cf04fe708d8090868e49356653a8e Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/9818 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/cluster/ec/src/ec-inode-write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index 3a6379a6a33..6b485a26fbc 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -900,9 +900,9 @@ int32_t ec_truncate_write(ec_fop_data_t * fop, uintptr_t mask)
vector.iov_base = iobuf->ptr;
vector.iov_len = fop->offset * ec->fragments - fop->user_size;
+ memset(vector.iov_base, 0, vector.iov_len);
- memset(iobuf->ptr, 0, vector.iov_len);
-
+ iobuf_unref (iobuf);
iobuf = NULL;
ec_writev(fop->frame, fop->xl, mask, fop->minimum, NULL, NULL, fop->fd,