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:
Peter Hutterer 2013-01-09 13:58:56 +10:00
parent 205cfbd6d9
commit f4a58469a2

View File

@ -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