server: Avoid reallocating rawinput device array with zero size.

It actually frees the pointer.
This commit is contained in:
Rémi Bernon 2022-08-05 15:46:05 +02:00 committed by Alexandre Julliard
parent 1cbbbd9d73
commit 28aa321f36

View file

@ -3380,6 +3380,14 @@ DECL_HANDLER(update_rawinput_devices)
size_t size = device_count * sizeof(*devices);
struct process *process = current->process;
if (!size)
{
process->rawinput_device_count = 0;
process->rawinput_mouse = NULL;
process->rawinput_kbd = NULL;
return;
}
if (!(tmp = realloc( process->rawinput_devices, size )))
{
set_error( STATUS_NO_MEMORY );