[JANITOR] Request for review

Kayo Hamid khflab at gmail.com
Sat Aug 6 05:13:38 UTC 2016


I'm trying to do one janitor task looking for bad allocations. Someone
could review my diff and see if is okay?

Thanks.

-- 
Kayo Hamid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160806/28f51242/attachment.html>
-------------- next part --------------
diff --git a/dix/enterleave.c b/dix/enterleave.c
index 1b341f2..8cec9a2 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -715,6 +715,13 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win)
     }
 
     sev = ev = xallocarray(evcount, sizeof(xEvent));
+
+    if(!ev) {
+        free(ev);
+        free(sev);
+        return BadAlloc;
+    }
+
     FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first);
 
     if (b != NULL) {


More information about the xorg-devel mailing list