summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dix/events.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dix/events.c b/dix/events.c
index f9b2ed766..c079f9756 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1438,7 +1438,8 @@ UpdateTouchesForGrab(DeviceIntPtr mouse)
listener->type = LISTENER_POINTER_GRAB;
else
listener->type = LISTENER_GRAB;
- FreeGrab(listener->grab);
+ if (listener->grab)
+ FreeGrab(listener->grab);
listener->grab = AllocGrab(grab);
}
}