7 Dec
2004
7 Dec
'04
5:22 a.m.
"Juan Lang" <juan_lang(a)yahoo.com> wrote:
+ if (DuplicateHandle(GetCurrentProcess(), MSVCRT_fdesc[od].handle, + GetCurrentProcess(), &handle, 0, + !(MSVCRT_fdesc[od].wxflag & WX_DONTINHERIT), DUPLICATE_SAME_ACCESS)) + { + ret = msvcrt_alloc_fd(handle, MSVCRT_fdesc[od].wxflag); + if (ret == -1) + *MSVCRT__errno() = MSVCRT_EMFILE; + }
You need to close duplicated handle in the case of msvcrt_alloc_fd failure. -- Dmitry.