Merge pull request #978 from enami/plug_handle_leak_on_windows

Plug windows handle leak when open failed.
This commit is contained in:
Francis Gulotta 2016-10-24 01:09:38 -04:00 • committed by GitHub
commit db22b19a80

View file

@ -88,6 +88,7 @@ void EIO_Open(uv_work_t* req) {
if (!GetCommState(file, &dcb)) {
ErrorCodeToString("Open (GetCommState)", GetLastError(), data->errorString);
CloseHandle(file);
return;
}
@ -142,6 +143,7 @@ void EIO_Open(uv_work_t* req) {
if (!SetCommState(file, &dcb)) {
ErrorCodeToString("Open (SetCommState)", GetLastError(), data->errorString);
CloseHandle(file);
return;
}
@ -155,6 +157,7 @@ void EIO_Open(uv_work_t* req) {
if (!SetCommTimeouts(file, &commTimeouts)) {
ErrorCodeToString("Open (SetCommTimeouts)", GetLastError(), data->errorString);
CloseHandle(file);
return;
}