xfree86: don't access the old input handler after freeing it
Introduced in 323869f329
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
205cfbd6d9
commit
f4a58469a2
|
@ -619,14 +619,16 @@ InputHandlerProc
|
||||||
xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
|
xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
|
||||||
{
|
{
|
||||||
static IHPtr handler = NULL;
|
static IHPtr handler = NULL;
|
||||||
IHPtr old_handler = handler;
|
InputHandlerProc old_proc = NULL;
|
||||||
|
|
||||||
if (old_handler)
|
if (handler) {
|
||||||
xf86RemoveGeneralHandler(old_handler);
|
old_proc = handler->ihproc;
|
||||||
|
xf86RemoveGeneralHandler(handler);
|
||||||
|
}
|
||||||
|
|
||||||
handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
|
handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
|
||||||
|
|
||||||
return (old_handler) ? old_handler->ihproc : NULL;
|
return old_proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue