summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dix/events.c b/dix/events.c
index 48cf7a244..d80290360 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1116,13 +1116,14 @@ NoticeEventTime(InternalEvent *ev)
void
EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
{
- QdEventPtr tail;
+ QdEventPtr tail = NULL;
QdEventPtr qe;
SpritePtr pSprite = device->spriteInfo->sprite;
int eventlen;
DeviceEvent *event = &ev->device_event;
- tail = list_last_entry(&syncEvents.pending, QdEventRec, next);
+ if (!list_is_empty(&syncEvents.pending))
+ tail = list_last_entry(&syncEvents.pending, QdEventRec, next);
NoticeTime((InternalEvent*)event);