Commit f4a58469 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

xfree86: don't access the old input handler after freeing it

Introduced in 323869f3

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
parent 205cfbd6
......@@ -619,14 +619,16 @@ InputHandlerProc
xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
{
static IHPtr handler = NULL;
IHPtr old_handler = handler;
InputHandlerProc old_proc = NULL;
if (old_handler)
xf86RemoveGeneralHandler(old_handler);
if (handler) {
old_proc = handler->ihproc;
xf86RemoveGeneralHandler(handler);
}
handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
return (old_handler) ? old_handler->ihproc : NULL;
return old_proc;
}
static void
......
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