Andrey Turkin : wordpad: Do not leak a handle on error path.
Module: wine Branch: master Commit: dfb64699bf8c8e643c85bb4b9e758437099d298c URL: http://source.winehq.org/git/wine.git/?a=commit;h=dfb64699bf8c8e643c85bb4b9e... Author: Andrey Turkin <andrey.turkin(a)gmail.com> Date: Sun Oct 12 15:09:45 2008 +0400 wordpad: Do not leak a handle on error path. --- programs/wordpad/wordpad.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 4186689..39a52bf 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -810,7 +810,10 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format) WriteFile(hFile, &unicode, sizeof(unicode), &writeOut, 0); if(writeOut != sizeof(unicode)) + { + CloseHandle(hFile); return; + } } stream.dwCookie = (DWORD_PTR)hFile;
participants (1)
-
Alexandre Julliard