]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix Leash build error with recent Visual Studio
authorGreg Hudson <ghudson@mit.edu>
Mon, 7 May 2018 02:29:40 +0000 (22:29 -0400)
committerGreg Hudson <ghudson@mit.edu>
Sun, 13 May 2018 03:50:34 +0000 (23:50 -0400)
Visual Studio 2015 and later do not allow manipulation of the _flag
field inside a file handle.  In Leash's out2con.cpp (used only for the
debugging -console flag), do not try to mark the allocated file handle
as free after copying it to *stdout; a one-time memory leak here is
unimportant.

ticket: 8679 (new)

src/windows/leash/out2con.cpp

index f7a1d35a95836454940bef0fdcf91b2d0b63f390..877eac14f118e0853664315f8c3b72458fc7555c 100644 (file)
@@ -96,9 +96,7 @@ ConsoleEcho::ConsoleEcho()
     FILE* fp = _fdopen(m_pipefd, "w");
     // copy to stdout
     *stdout = *fp;
-    // now slam the allocated FILE's _flag to zero to mark it as free without
-    // actually closing the os file handle and pipe
-    fp->_flag = 0;
+    // fp leaks, but we can't close it without closing the OS file handle
 
     // disable buffering
     setvbuf(stdout, NULL, _IONBF, 0);