kernel32: Don't leak an event handle on errors.

This commit is contained in:
Grazvydas Ignotas 2015-05-16 22:29:42 +03:00 committed by Alexandre Julliard
parent 70bff7377d
commit 2e21381177
1 changed files with 3 additions and 1 deletions

View File

@ -190,12 +190,14 @@ BOOL WINAPI ReadDirectoryChangesW( HANDLE handle, LPVOID buffer, DWORD len, BOOL
return TRUE;
WaitForSingleObjectEx( ov.hEvent, INFINITE, TRUE );
CloseHandle( ov.hEvent );
if (returned)
*returned = ios->Information;
status = ios->u.Status;
}
if (!overlapped)
CloseHandle( ov.hEvent );
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );