user32: Only call GlobalUnlock when GlobalLock was successful.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-09-07 20:51:49 +02:00 committed by Alexandre Julliard
parent f9d4057574
commit a78fd8a07e
1 changed files with 5 additions and 2 deletions

View File

@ -89,8 +89,11 @@ static LCID get_clipboard_locale(void)
if ((data = GetClipboardData( CF_LOCALE )))
{
LCID *ptr = GlobalLock( data );
if (ptr && GlobalSize( data ) >= sizeof(*ptr)) lcid = *ptr;
GlobalUnlock( data );
if (ptr)
{
if (GlobalSize( data ) >= sizeof(*ptr)) lcid = *ptr;
GlobalUnlock( data );
}
}
return lcid;
}