Avoid a crash in free_window_handle() on an invalid window handle.

This commit is contained in:
Dmitry Timoshkov 2005-05-13 13:58:17 +00:00 committed by Alexandre Julliard
parent 71ff4c4f4e
commit 3f5990eb9a
1 changed files with 3 additions and 1 deletions

View File

@ -139,14 +139,16 @@ static WND *free_window_handle( HWND hwnd )
{
req->handle = hwnd;
if (!wine_server_call_err( req ))
{
user_handles[index] = NULL;
ptr->dwMagic = 0;
}
else
ptr = NULL;
}
SERVER_END_REQ;
}
USER_Unlock();
ptr->dwMagic = 0;
HeapFree( GetProcessHeap(), 0, ptr );
return ptr;
}