Commit 28aa321f authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

server: Avoid reallocating rawinput device array with zero size.

It actually frees the pointer.
parent 1cbbbd9d
...@@ -3380,6 +3380,14 @@ DECL_HANDLER(update_rawinput_devices) ...@@ -3380,6 +3380,14 @@ DECL_HANDLER(update_rawinput_devices)
size_t size = device_count * sizeof(*devices); size_t size = device_count * sizeof(*devices);
struct process *process = current->process; 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 ))) if (!(tmp = realloc( process->rawinput_devices, size )))
{ {
set_error( STATUS_NO_MEMORY ); set_error( STATUS_NO_MEMORY );
......
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