Commit e27a95e9 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

d3dx9: Avoid closing invalid handles.

parent 175a3649
......@@ -134,8 +134,10 @@ HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length)
return S_OK;
error:
CloseHandle(hmapping);
CloseHandle(hfile);
if (hmapping)
CloseHandle(hmapping);
if (hfile != INVALID_HANDLE_VALUE)
CloseHandle(hfile);
return HRESULT_FROM_WIN32(GetLastError());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment