diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 464396f9d..20e42d8a3 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -361,7 +361,7 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) }; DrawablePtr pDrawable; int X, Y, W, H; - drm_clip_rect_t *pClipRects, *pClippedRects = NULL; + drm_clip_rect_t *pClipRects; drm_clip_rect_t *pBackClipRects; int backX, backY, rc; @@ -405,12 +405,10 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) if (rep.numBackClipRects) rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; + drm_clip_rect_t pClippedRects[rep.numClipRects]; + if (rep.numClipRects) { /* Clip cliprects to screen dimensions (redirected windows) */ - pClippedRects = xallocarray(rep.numClipRects, sizeof(drm_clip_rect_t)); - - if (!pClippedRects) - return BadAlloc; ScreenPtr pScreen = screenInfo.screens[stuff->screen]; int i, j; @@ -441,7 +439,6 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, pClippedRects); - free(pClippedRects); } if (rep.numBackClipRects) {