Commit 3f5990eb authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent 71ff4c4f
...@@ -139,14 +139,16 @@ static WND *free_window_handle( HWND hwnd ) ...@@ -139,14 +139,16 @@ static WND *free_window_handle( HWND hwnd )
{ {
req->handle = hwnd; req->handle = hwnd;
if (!wine_server_call_err( req )) if (!wine_server_call_err( req ))
{
user_handles[index] = NULL; user_handles[index] = NULL;
ptr->dwMagic = 0;
}
else else
ptr = NULL; ptr = NULL;
} }
SERVER_END_REQ; SERVER_END_REQ;
} }
USER_Unlock(); USER_Unlock();
ptr->dwMagic = 0;
HeapFree( GetProcessHeap(), 0, ptr ); HeapFree( GetProcessHeap(), 0, ptr );
return ptr; return ptr;
} }
......
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