diff options
author | Dave Airlie <airlied@redhat.com> | 2012-04-14 15:01:16 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-04-14 15:01:33 +0100 |
commit | 87ddde9511d01138a10f38356545923d758e5408 (patch) | |
tree | 8e14c045d3e4e3bac16384bf8ad1f20a2c573ec0 | |
parent | 6760dfc692dd4d3f662cc82e5b7610f8ec2ebdc0 (diff) |
drop use of alloca, just use malloc/free
Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/driver.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/driver.c b/src/driver.c index 87431ff..95d6b90 100644 --- a/src/driver.c +++ b/src/driver.c @@ -324,7 +324,7 @@ static void dispatch_dirty(ScreenPtr pScreen) unsigned num_cliprects = REGION_NUM_RECTS(dirty); if (num_cliprects) { - drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip)); + drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip)); BoxPtr rect = REGION_RECTS(dirty); int i, ret; @@ -338,6 +338,7 @@ static void dispatch_dirty(ScreenPtr pScreen) /* TODO query connector property to see if this is needed */ ret = drmModeDirtyFB(ms->fd, ms->drmmode.fb_id, clip, num_cliprects); + free(clip); if (ret) { if (ret == -EINVAL || ret == -ENOSYS) { ms->dirty_enabled = FALSE; |