summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2016-08-02 11:59:42 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-08-05 03:56:57 -0700
commitd297d2bdfc4d5ba99c37b22dd1ae0f8e8e92fe7b (patch)
tree42ec5a59db2a7dc4ff17b18db5606ead5629c870 /xlators
parent5ae0a5d1e92175c28cd5470b890e99ff4eac0673 (diff)
meta: fix memory leak in meta xlators
meta xlator is leaking iobuf and iobrefs in read path This patch fixes memleak in meta_default_read code path Change-Id: Ieb413267604d9870dbe6e11258fffd279a7bd7cf BUG: 1362397 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/15068 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/meta/src/meta-defaults.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/meta/src/meta-defaults.c b/xlators/meta/src/meta-defaults.c
index 5a8558291ba..045fe79dbbc 100644
--- a/xlators/meta/src/meta-defaults.c
+++ b/xlators/meta/src/meta-defaults.c
@@ -148,6 +148,9 @@ meta_default_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
return default_readv_failure_cbk (frame, ENOMEM);
}
+ /* iobref would have taken a ref */
+ iobuf_unref (iobuf);
+
iov.iov_base = iobuf_ptr (iobuf);
copy_offset = min (meta_fd->size, offset);
@@ -159,6 +162,8 @@ meta_default_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
META_STACK_UNWIND (readv, frame, copy_size, 0, &iov, 1, &iatt, iobref, 0);
+ iobref_unref (iobref);
+
return 0;
}