summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-08-10 09:20:14 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-08-10 09:20:14 +0800
commitccde9fb3683d22c7695cb1357c48e9b798102353 (patch)
treebada1269ae44a5c4ecc4d2c230e124cb5dedc6ec /src/window.cpp
parent4ae704fbfb8635bf6cc4a32bea29658463a74126 (diff)
downloadunity-window-decorator-ccde9fb3683d22c7695cb1357c48e9b798102353.tar.gz
unity-window-decorator-ccde9fb3683d22c7695cb1357c48e9b798102353.tar.bz2
Don't free a local variable by creating a pointer to it and then not
knowing whether that pointer is actually heap or stack memory
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 09d51ce..9c4b92b 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -908,8 +908,8 @@ PrivateWindow::rectsToRegion (unsigned int n, XRectangle *rects)
void
PrivateWindow::updateRegion ()
{
- XRectangle r, *boundingShapeRects = 0;
- XRectangle *inputShapeRects = 0;
+ XRectangle r, *boundingShapeRects = NULL;
+ XRectangle *inputShapeRects = NULL;
int nBounding = 0, nInput = 0;
priv->region = CompRegion ();
@@ -946,9 +946,9 @@ PrivateWindow::updateRegion ()
priv->region += rectsToRegion (nBounding, boundingShapeRects);
priv->inputRegion += rectsToRegion (nInput, inputShapeRects);
- if (boundingShapeRects)
+ if (boundingShapeRects && boundingShapeRects != &r)
XFree (boundingShapeRects);
- if (inputShapeRects)
+ if (inputShapeRects && inputShapeRects != &r)
XFree (inputShapeRects);
window->updateFrameRegion ();