diff options
Diffstat (limited to 'nx-X11/programs/Xserver/randr')
-rw-r--r-- | nx-X11/programs/Xserver/randr/rrcrtc.c | 10 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/randr/rroutput.c | 9 |
2 files changed, 7 insertions, 12 deletions
diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index 7775747f8..20ab73c5b 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -89,13 +89,10 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) pScrPriv = rrGetScrPriv(pScreen); /* make space for the crtc pointer */ - if (pScrPriv->numCrtcs) - crtcs = reallocarray(pScrPriv->crtcs, - pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr)); - else - crtcs = malloc(sizeof(RRCrtcPtr)); + crtcs = reallocarray(pScrPriv->crtcs, + pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr)); if (!crtcs) - return FALSE; + return NULL; pScrPriv->crtcs = crtcs; crtc = calloc(1, sizeof(RRCrtcRec)); @@ -772,6 +769,7 @@ RRCrtcDestroyResource(void *value, XID pid) free(crtc->gammaRed); if (crtc->mode) RRModeDestroy(crtc->mode); + free(crtc->outputs); free(crtc); return 1; } diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 8042b719c..9c52eaed6 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -74,13 +74,10 @@ RROutputCreate(ScreenPtr pScreen, pScrPriv = rrGetScrPriv(pScreen); - if (pScrPriv->numOutputs) - outputs = reallocarray(pScrPriv->outputs, - pScrPriv->numOutputs + 1, sizeof(RROutputPtr)); - else - outputs = malloc(sizeof(RROutputPtr)); + outputs = reallocarray(pScrPriv->outputs, + pScrPriv->numOutputs + 1, sizeof(RROutputPtr)); if (!outputs) - return FALSE; + return NULL; pScrPriv->outputs = outputs; |