From 71cffc0b66b849306778515d385083b9f78857f5 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Fri, 2 Mar 2012 00:54:12 +0530 Subject: Fix memory leaks found in readdir Change-Id: I0e221e4de9ee12586b09cd8bf7f394e9d4b88a11 BUG: 765785 Reviewed-on: http://review.gluster.com/2853 Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat Reviewed-by: Krishnan Parthasarathi Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Vijay Bellur --- xlators/performance/md-cache/src/md-cache.c | 2 ++ xlators/protocol/client/src/client3_1-fops.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 5bc3c8e0e..5fa6e214b 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -1700,6 +1700,8 @@ mdc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, STACK_WIND (frame, mdc_readdirp_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->readdirp, fd, size, offset, xattr_req); + + dict_unref (xattr_req); return 0; } diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index 89c6e287c..b460b167b 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -5076,6 +5076,9 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, goto unwind; } + if (req.dict.dict_val) + GF_FREE (req.dict.dict_val); + return 0; unwind: gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); @@ -5091,6 +5094,9 @@ unwind: iobuf_unref (rsp_iobuf); } + if (req.dict.dict_val) + GF_FREE (req.dict.dict_val); + STACK_UNWIND_STRICT (readdirp, frame, -1, op_errno, NULL); return 0; } -- cgit