xserver: Branch 'master'
Peter Hutterer
whot at kemper.freedesktop.org
Thu Jun 28 19:31:01 PDT 2007
dix/grabs.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
New commits:
diff-tree 2691c05fd647d9fa10f791ac397ecb9c423a076f (from f7f3fe7fe7233a2ffc43106c48f44cbbd82b7c19)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Fri Jun 29 11:56:18 2007 +0930
Make sure window->optional is allocated before assigning it.
DeletePassiveGrabFromList() may remove the window optional, so we need to
re-alloc it if it isn't there anymore.
Thanks to Colin Harrison for spotting the bug.
diff --git a/dix/grabs.c b/dix/grabs.c
index cecd7ec..2210cd0 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -322,12 +322,6 @@ AddPassiveGrabToList(GrabPtr pGrab)
}
}
- if (!pGrab->window->optional && !MakeWindowOptional (pGrab->window))
- {
- FreeGrab(pGrab);
- return BadAlloc;
- }
-
/* Remove all grabs that match the new one exactly */
for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next)
{
@@ -338,6 +332,12 @@ AddPassiveGrabToList(GrabPtr pGrab)
}
}
+ if (!pGrab->window->optional && !MakeWindowOptional (pGrab->window))
+ {
+ FreeGrab(pGrab);
+ return BadAlloc;
+ }
+
pGrab->next = pGrab->window->optional->passiveGrabs;
pGrab->window->optional->passiveGrabs = pGrab;
if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (pointer)pGrab))
More information about the xorg-commit
mailing list