From 85471322df9676cc344cc2b03627c02ed90da3cd Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 23 Feb 2012 22:58:44 +0530 Subject: glusterfsd: unref the dict and free the memory to avoid memleak Change-Id: Ib7a1f8cbab039fefb73dc35560a035d5688b0e32 BUG: 796186 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/2808 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/protocol/server/src/server-helpers.c | 2 ++ xlators/storage/posix/src/posix.c | 1 + 2 files changed, 3 insertions(+) (limited to 'xlators') diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 11824b27f..cfa5ea46e 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -1456,6 +1456,8 @@ readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp) prev = trav; while (trav) { trav = trav->nextentry; + if (prev->dict.dict_val) + GF_FREE (prev->dict.dict_val); GF_FREE (prev); prev = trav; } diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 1b4d1a335..a59d2c383 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3622,6 +3622,7 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, posix_entry_xattr_fill (this, tmp_entry->inode, fd, tmp_entry->d_name, dict, &stbuf); + dict_ref (tmp_entry->dict); } tmp_entry->d_stat = stbuf; -- cgit