Module: wine Branch: master Commit: 2e21381177c4ae5c1abb02cd8db364075f901444 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2e21381177c4ae5c1abb02cd8d...
Author: Grazvydas Ignotas notasas@gmail.com Date: Sat May 16 22:29:42 2015 +0300
kernel32: Don't leak an event handle on errors.
---
dlls/kernel32/change.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/change.c b/dlls/kernel32/change.c index f3aec8d..781ccfe 100644 --- a/dlls/kernel32/change.c +++ b/dlls/kernel32/change.c @@ -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) );