mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 05:14:46 +00:00
win32u: Avoid reallocating rawinput device array with zero size.
It actually frees the pointer.
This commit is contained in:
parent
28aa321f36
commit
b5ed538993
|
@ -856,6 +856,12 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d
|
|||
|
||||
pthread_mutex_lock( &rawinput_mutex );
|
||||
|
||||
if (!registered_device_count && !device_count)
|
||||
{
|
||||
pthread_mutex_unlock( &rawinput_mutex );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
size = (SIZE_T)device_size * (registered_device_count + device_count);
|
||||
registered_devices = realloc( registered_devices, size );
|
||||
if (registered_devices) for (i = 0; i < device_count; ++i) register_rawinput_device( devices + i );
|
||||
|
|
Loading…
Reference in a new issue