summaryrefslogtreecommitdiffstats
path: root/xlators/features/index
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@redhat.com>2014-01-27 17:49:29 -0600
committerVijay Bellur <vbellur@redhat.com>2014-02-04 09:52:39 -0800
commit21a83b8be06aa73f40b83b9cfc97dc8a1972190a (patch)
treedee0cd04c30e757e912860cabafb85d0f0c4fafe /xlators/features/index
parent797c62eb56797189b51a1dcb35009499f920a3ea (diff)
downloadglusterfs-21a83b8be06aa73f40b83b9cfc97dc8a1972190a.tar.gz
glusterfs-21a83b8be06aa73f40b83b9cfc97dc8a1972190a.tar.xz
glusterfs-21a83b8be06aa73f40b83b9cfc97dc8a1972190a.zip
features/index: Loop exit without freeing in-use memory.
If the while loop is exited via the goto, the call to closedir(3) is skipped, leaving an open directory stream. This patch ensure that the directory is closed if the loop is exited via the goto. BUG: 789278 CID: 1124763 Change-Id: Iec5da4b8d32c0a93c10d035ff38d0c063fd97cda Signed-off-by: Christopher R. Hertel <crh@redhat.com> Reviewed-on: http://review.gluster.org/6828 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/index')
-rw-r--r--xlators/features/index/src/index.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index ce037aa244..ec395e8a4b 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -490,8 +490,10 @@ sync_base_indices_from_xattrop (xlator_t *this)
continue;
}
ret = unlink (entry->d_name);
- if (ret)
+ if (ret) {
+ closedir (dir);
goto out;
+ }
}
closedir (dir);
}