mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-26 05:20:05 +01:00
xfree86: don't access the old input handler after freeing it
Introduced in323869f329Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commitf4a58469a2)
This commit is contained in:
parent
f7f566f9e3
commit
d07dfb11c2
1 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue