summaryrefslogtreecommitdiff
path: root/randr/rrscreen.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@guitar.keithp.com>2006-09-20 12:05:52 -0700
committerKeith Packard <keithp@guitar.keithp.com>2006-09-20 12:05:52 -0700
commitd08718d8fd31477e90f13b9e122504c515b46ee0 (patch)
tree2c65df397d32909eebd8ddedc7196cbce3f37852 /randr/rrscreen.c
parentef1f3248cb5fff0a02c0059f865c4d931eba23a6 (diff)
Avoid calling xalloc(0). Change rrScreenSizeSet to rrScreenSetSize.
Diffstat (limited to 'randr/rrscreen.c')
-rw-r--r--randr/rrscreen.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 58d5152d0..617ae4109 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -187,9 +187,9 @@ RRScreenSizeSet (ScreenPtr pScreen,
rrScrPriv(pScreen);
#if RANDR_12_INTERFACE
- if (pScrPriv->rrScreenSizeSet)
+ if (pScrPriv->rrScreenSetSize)
{
- return (*pScrPriv->rrScreenSizeSet) (pScreen,
+ return (*pScrPriv->rrScreenSetSize) (pScreen,
width, height,
mmWidth, mmHeight);
}
@@ -376,9 +376,14 @@ ProcRRGetScreenResources (ClientPtr client)
((rep.nbytesNames + 3) >> 2));
extraLen = rep.length << 2;
- extra = xalloc (extraLen);
- if (!extra)
- return BadAlloc;
+ if (extraLen)
+ {
+ extra = xalloc (extraLen);
+ if (!extra)
+ return BadAlloc;
+ }
+ else
+ extra = NULL;
crtcs = (RRCrtc *) extra;
outputs = (RROutput *) (crtcs + pScrPriv->numCrtcs);
@@ -595,12 +600,18 @@ ProcRRGetScreenInfo (ClientPtr client)
extraLen = (rep.nSizes * sizeof (xScreenSizes) +
rep.nrateEnts * sizeof (CARD16));
- extra = (CARD8 *) xalloc (extraLen);
- if (!extra)
+ if (extraLen)
{
- xfree (pData);
- return BadAlloc;
+ extra = (CARD8 *) xalloc (extraLen);
+ if (!extra)
+ {
+ xfree (pData);
+ return BadAlloc;
+ }
}
+ else
+ extra = NULL;
+
/*
* First comes the size information
*/