From c1cb976b66deaf19b58bac9c0df83e1896a4797d Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Thu, 10 Sep 2009 10:53:38 +0200
Subject: [PATCH] ntdll: Fix a file descriptor leak.

---
 dlls/ntdll/directory.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 0cd531eee4b..413b96f707a 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2329,6 +2329,7 @@ NTSTATUS DIR_get_unix_cwd( char **cwd )
         else status = FILE_GetNtStatus();
 
         RtlLeaveCriticalSection( &dir_section );
+        if (old_cwd != -1) close( old_cwd );
         if (needs_close) close( unix_fd );
     }
     if (!curdir->Handle) NtClose( handle );
-- 
GitLab