summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-08-04 12:40:19 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-08-04 12:40:19 +0300
commita406f6bfeaa46e3236f7ab46813fe6c30b936a35 (patch)
tree29c02d2195e72b1d4505df407fcfeb68a919732d /mi
parent997ba45b192f21810099ed888792a45f1677a9ce (diff)
mieq: don't leak events
free all events posted through mieqEnqueue.
Diffstat (limited to 'mi')
-rw-r--r--mi/mieq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 8dbf166a6..0d9dcb8b4 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -124,6 +124,7 @@ mieqEnqueue (xEvent *e)
if (e->u.u.type == DeviceValuator) {
if (laste->nevents >= 6) {
ErrorF("mieqEnqueue: more than six valuator events; dropping.\n");
+ free(e);
return;
}
if (oldtail == miEventQueue.head ||
@@ -133,6 +134,7 @@ mieqEnqueue (xEvent *e)
((lastkbp->deviceid & DEVICE_BITS) !=
(v->deviceid & DEVICE_BITS))) {
ErrorF("mieqEnequeue: out-of-order valuator event; dropping.\n");
+ free(e);
return;
}
laste->event[laste->nevents++] = *e;
@@ -159,6 +161,7 @@ mieqEnqueue (xEvent *e)
/* Toss events which come in late */
if (newtail == miEventQueue.head) {
ErrorF("tossed event which came in late\n");
+ free(e);
return;
}
miEventQueue.tail = newtail;
@@ -235,5 +238,7 @@ void mieqProcessInputEvents ()
++miEventQueue.head;
(*e->pDev->public.processInputProc)(e->event, e->pDev, e->nevents);
}
+
+ free(e->event);
}
}