From 58bff17e43a80eb21b3ff6d4bb1596230e61f707 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 13 Dec 2012 11:49:54 +1000 Subject: Xi: don't use devices after removing them RemoveDevice() frees the DeviceIntPtr, we shouldn't use the pointer after that Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- Xi/xichangehierarchy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Xi') diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 89f16d8be..4dc3d76e9 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -304,15 +304,16 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES]) flags[keybd->id] |= XIDeviceDisabled; flags[ptr->id] |= XIDeviceDisabled; - RemoveDevice(XTestptr, FALSE); - RemoveDevice(XTestkeybd, FALSE); - RemoveDevice(keybd, FALSE); - RemoveDevice(ptr, FALSE); flags[XTestptr->id] |= XISlaveRemoved; flags[XTestkeybd->id] |= XISlaveRemoved; flags[keybd->id] |= XIMasterRemoved; flags[ptr->id] |= XIMasterRemoved; + RemoveDevice(XTestptr, FALSE); + RemoveDevice(XTestkeybd, FALSE); + RemoveDevice(keybd, FALSE); + RemoveDevice(ptr, FALSE); + unwind: return rc; } -- cgit v1.2.3