Commit a78fd8a0 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

user32: Only call GlobalUnlock when GlobalLock was successful.

parent f9d40575
...@@ -89,8 +89,11 @@ static LCID get_clipboard_locale(void) ...@@ -89,8 +89,11 @@ static LCID get_clipboard_locale(void)
if ((data = GetClipboardData( CF_LOCALE ))) if ((data = GetClipboardData( CF_LOCALE )))
{ {
LCID *ptr = GlobalLock( data ); LCID *ptr = GlobalLock( data );
if (ptr && GlobalSize( data ) >= sizeof(*ptr)) lcid = *ptr; if (ptr)
GlobalUnlock( data ); {
if (GlobalSize( data ) >= sizeof(*ptr)) lcid = *ptr;
GlobalUnlock( data );
}
} }
return lcid; return lcid;
} }
......
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