wordpad: Do not leak a handle on error path.
This commit is contained in:
parent
ef23ef9335
commit
dfb64699bf
@ -810,8 +810,11 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
|
|||||||
WriteFile(hFile, &unicode, sizeof(unicode), &writeOut, 0);
|
WriteFile(hFile, &unicode, sizeof(unicode), &writeOut, 0);
|
||||||
|
|
||||||
if(writeOut != sizeof(unicode))
|
if(writeOut != sizeof(unicode))
|
||||||
|
{
|
||||||
|
CloseHandle(hFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stream.dwCookie = (DWORD_PTR)hFile;
|
stream.dwCookie = (DWORD_PTR)hFile;
|
||||||
stream.pfnCallback = stream_out;
|
stream.pfnCallback = stream_out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user