[newlib-cygwin] cygwin: Fix resource leak in readdir reparse point handling

Corinna Vinschen corinna@sourceware.org
Mon Jul 24 15:33:00 GMT 2017


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=be1485191f17b63dacea88f2f3fc4e68e9fec36e

commit be1485191f17b63dacea88f2f3fc4e68e9fec36e
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Jul 24 17:26:17 2017 +0200

    cygwin: Fix resource leak in readdir reparse point handling
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_disk_file.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index ca1da38..6cc081d 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -216,8 +216,8 @@ readdir_check_reparse_point (POBJECT_ATTRIBUTES attr, bool remote)
 		    ret = true;
 		}
 	    }
-	  NtClose (reph);
 	}
+      NtClose (reph);
     }
   return ret;
 }



More information about the Cygwin-cvs mailing list