msvcrt-A09: _close bugfix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch in the msvcrt-A?? series fixes a bug in the _close 
implementation in that a close on a dupped file descriptor from 
STDIN/STDOUT/STDERR might try and free the non-dynamic MSVCRT_FILE* 
structure assigned to the original STDIN/STDOUT/STDERR file descriptor.

License:
LGPL

Changelog:
* dlls/msvcrt/file.c: Jaco Greeff <jaco@puxedo.org>
- Make sure that the _close of _dup'ed file descriptors desn't try to 
free the MSVCRT_FILE structures associated with STDIN/STDOUT/STDERR

--[ inline patch ]--

diff -aurN msvcrt-A08/dlls/msvcrt/file.c msvcrt-A09/dlls/msvcrt/file.c
--- msvcrt-A08/dlls/msvcrt/file.c	Mon Nov  4 13:49:55 2002
+++ msvcrt-A09/dlls/msvcrt/file.c	Mon Nov  4 14:07:29 2002
@@ -474,7 +474,7 @@
              }

              /* Dont free std FILE*'s, they are not dynamic */
-            if (fd > 2 && MSVCRT_files[i])
+            if (i > 2 && MSVCRT_files[i])
              {
                  MSVCRT_free(MSVCRT_files[i]);
                  MSVCRT_files[i] = NULL;



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux