aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/xpr
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-07-14 06:40:19 +0000
committermarha <marha@users.sourceforge.net>2010-07-14 06:40:19 +0000
commit865af20e32591176d03acf984d9b5788d5ebce21 (patch)
treed5e216fa6fa5cdbb83834cc38bd5b96fc41c97de /xorg-server/hw/xquartz/xpr
parent81124070f120ab658e094b64f6944d701b003a99 (diff)
downloadvcxsrv-865af20e32591176d03acf984d9b5788d5ebce21.tar.gz
vcxsrv-865af20e32591176d03acf984d9b5788d5ebce21.tar.bz2
vcxsrv-865af20e32591176d03acf984d9b5788d5ebce21.zip
xserver libxcb git update 14/7/2010
Diffstat (limited to 'xorg-server/hw/xquartz/xpr')
-rw-r--r--xorg-server/hw/xquartz/xpr/xprCursor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c
index 9c7890647..07dd5c8fb 100644
--- a/xorg-server/hw/xquartz/xpr/xprCursor.c
+++ b/xorg-server/hw/xquartz/xpr/xprCursor.c
@@ -67,6 +67,7 @@ static Bool
load_cursor(CursorPtr src, int screen)
{
uint32_t *data;
+ Bool free_data = FALSE;
uint32_t rowbytes;
int width, height;
int hot_x, hot_y;
@@ -95,6 +96,7 @@ load_cursor(CursorPtr src, int screen)
unsigned i;
rowbytes = src->bits->width * sizeof (CARD32);
data = malloc(rowbytes * src->bits->height);
+ free_data = TRUE;
if(!data) {
FatalError("Failed to allocate memory in %s\n", __func__);
}
@@ -121,6 +123,7 @@ load_cursor(CursorPtr src, int screen)
/* round up to 8 pixel boundary so we can convert whole bytes */
rowbytes = ((src->bits->width * 4) + 31) & ~31;
data = malloc(rowbytes * src->bits->height);
+ free_data = TRUE;
if(!data) {
FatalError("Failed to allocate memory in %s\n", __func__);
}
@@ -173,7 +176,8 @@ load_cursor(CursorPtr src, int screen)
}
err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes);
- free(data);
+ if(free_data)
+ free(data);
return err == Success;
}