summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selection.c3
-rw-r--r--tab.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/selection.c b/selection.c
index 53d2f9d..cab8866 100644
--- a/selection.c
+++ b/selection.c
@@ -39,6 +39,9 @@ groupWindowInRegion (CompWindow *w,
BOX *box;
buf = XCreateRegion ();
+ if (!buf) {
+ return FALSE;
+ }
XIntersectRegion (w->region, src, buf);
/* buf area */
diff --git a/tab.c b/tab.c
index d0ccff6..094f0dc 100644
--- a/tab.c
+++ b/tab.c
@@ -74,12 +74,20 @@ groupGetClippingRegion (CompWindow *w)
CompWindow *cw;
Region clip = XCreateRegion();
+ if (!clip) {
+ return NULL;
+ }
+
for (cw = w->next; cw; cw = cw->next)
{
if (!cw->invisible && !(cw->state & CompWindowStateHiddenMask))
{
XRectangle rect;
Region buf = XCreateRegion();
+ if (!buf) {
+ XDestroyRegion(clip);
+ return NULL;
+ }
rect.x = WIN_REAL_X (cw);
rect.y = WIN_REAL_Y (cw);
@@ -506,6 +514,10 @@ groupHandleHoverDetection (GroupSelection *group)
covers a port of that slot, this part won't be used
for in-slot-detection. */
Region reg = XCreateRegion();
+ if (!reg) {
+ XDestroyRegion(clip);
+ return;
+ }
XSubtractRegion (slot->region, clip, reg);
if (XPointInRegion (reg, mouseX, mouseY))
@@ -1277,6 +1289,9 @@ groupUpdateTabBars (CompScreen *s,
{
XRectangle rect;
Region reg = XCreateRegion();
+ if (!reg) {
+ return;
+ }
rect.x = WIN_X (w) - w->input.left;
rect.y = WIN_Y (w) - w->input.top;