summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-02-23 22:58:44 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-27 02:17:34 -0800
commit85471322df9676cc344cc2b03627c02ed90da3cd (patch)
tree7784d17a0913e314658fd25a496c0508a093fabe
parentbd94f6a1cc26fbcf8811e04dab0c90257b44d89a (diff)
glusterfsd: unref the dict and free the memory to avoid memleak
Change-Id: Ib7a1f8cbab039fefb73dc35560a035d5688b0e32 BUG: 796186 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2808 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/protocol/server/src/server-helpers.c2
-rw-r--r--xlators/storage/posix/src/posix.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 11824b27f60..cfa5ea46e0e 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 1b4d1a335c0..a59d2c383fd 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;