windows: fix handle leak on EMFILE
If CreateFileW succeeds, but _open_osfhandle fails, the handle must be closed. PR-URL: https://github.com/libuv/libuv/pull/278 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
parent
3616e61439
commit
12c93608d0
@ -511,6 +511,7 @@ void fs__open(uv_fs_t* req) {
|
||||
SET_REQ_WIN32_ERROR(req, GetLastError());
|
||||
else
|
||||
SET_REQ_WIN32_ERROR(req, UV_UNKNOWN);
|
||||
CloseHandle(file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user