diff options
author | Christopher R. Hertel <crh@redhat.com> | 2014-01-27 17:49:29 -0600 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-02-04 09:52:39 -0800 |
commit | 21a83b8be06aa73f40b83b9cfc97dc8a1972190a (patch) | |
tree | dee0cd04c30e757e912860cabafb85d0f0c4fafe /xlators | |
parent | 797c62eb56797189b51a1dcb35009499f920a3ea (diff) |
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')
-rw-r--r-- | xlators/features/index/src/index.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index ce037aa244b..ec395e8a4bb 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); } |