summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2015-01-07 15:16:32 +0530
committerVijay Bellur <vbellur@redhat.com>2015-01-08 02:05:14 -0800
commitd0b07fae1fece688333888cfc408bc7c031ae8bf (patch)
tree87cacdac46583b50fc78a2d406a14014a0503767
parent250944d56c0d942db07c194412acca27976a0310 (diff)
avoid memory leaks in snapview-server
* snapview-server in readdirp, creates the inode for entries with names "." and ".." for each readdirp operation without creating dentries leading to memleak. It should have avoided creation of inodes for those entries Change-Id: I3b2025fd10872fcc3303d0becec764ffd4e37601 BUG: 1179663 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9404 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/features/snapview-server/src/snapview-server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index 040f444f82f..4df7864b1bf 100644
--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -1335,6 +1335,9 @@ svs_readdirp_fill (xlator_t *this, inode_t *parent, svs_inode_t *parent_ctx,
GF_VALIDATE_OR_GOTO (this->name, parent_ctx, out);
GF_VALIDATE_OR_GOTO (this->name, entry, out);
+ if (!strcmp (entry->d_name, ".") || !strcmp (entry->d_name, ".."))
+ goto out;
+
inode = inode_grep (parent->table, parent, entry->d_name);
if (inode) {
entry->inode = inode;