ntdll: Fix a file descriptor leak.
authorAlexandre Julliard <julliard@winehq.org>
Thu, 10 Sep 2009 08:53:38 +0000 (10:53 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 10 Sep 2009 08:53:38 +0000 (10:53 +0200)
dlls/ntdll/directory.c

index 0cd531eee4b2dfe0f6a057dad2333c3870bb1ae2..413b96f707a59f219cc573688b3e62e6a339accd 100644 (file)
@@ -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 );