diff options
author | Greg Hudson <ghudson@mit.edu> | 2018-05-06 22:29:40 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2018-05-12 23:50:34 -0400 |
commit | e7315768eb52ad44e73ff1c51ef18fe5371412fc (patch) | |
tree | 94253a986b5653637b25a8719f6763cf611d1312 /src/windows | |
parent | eb46a725a0236ee275ee97c739cef475623d42c6 (diff) | |
download | krb5-e7315768eb52ad44e73ff1c51ef18fe5371412fc.zip krb5-e7315768eb52ad44e73ff1c51ef18fe5371412fc.tar.gz krb5-e7315768eb52ad44e73ff1c51ef18fe5371412fc.tar.bz2 |
Fix Leash build error with recent Visual Studio
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)
Diffstat (limited to 'src/windows')
-rw-r--r-- | src/windows/leash/out2con.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/windows/leash/out2con.cpp b/src/windows/leash/out2con.cpp index f7a1d35..877eac1 100644 --- a/src/windows/leash/out2con.cpp +++ b/src/windows/leash/out2con.cpp @@ -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); |