From 21a83b8be06aa73f40b83b9cfc97dc8a1972190a Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 27 Jan 2014 17:49:29 -0600 Subject: 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 Reviewed-on: http://review.gluster.org/6828 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/index/src/index.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index ce037aa24..ec395e8a4 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); } -- cgit