summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin E Martin <kem@redhat.com>2009-09-22 11:42:24 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-22 12:28:17 +1000
commit66ece3bfb19642bf0f1ef73c3caa8a99c3dfb5a9 (patch)
tree1e9f6c3706c68f2e6b066da059d870216d09736d
parent20fb8c2e2fccb28c1b89e6e2a5c685e1287baedb (diff)
dmx: only free the default pixmaps that we actually allocated.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/dmx/dmxscrinit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c
index cab212d35..09734f56d 100644
--- a/hw/dmx/dmxscrinit.c
+++ b/hw/dmx/dmxscrinit.c
@@ -388,8 +388,11 @@ void dmxBECloseScreen(ScreenPtr pScreen)
} else {
/* Free the default drawables */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
- XFreePixmap(dmxScreen->beDisplay, dmxScreen->scrnDefDrawables[i]);
- dmxScreen->scrnDefDrawables[i] = (Drawable)0;
+ if (dmxScreen->scrnDefDrawables[i]) {
+ XFreePixmap(dmxScreen->beDisplay,
+ dmxScreen->scrnDefDrawables[i]);
+ dmxScreen->scrnDefDrawables[i] = (Drawable)0;
+ }
}
}