diff options
Diffstat (limited to 'common/region.c')
-rw-r--r-- | common/region.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/region.c b/common/region.c index 7edcb5a1..95ac8ca5 100644 --- a/common/region.c +++ b/common/region.c @@ -23,6 +23,7 @@ #include "region.h" #include "rect.h" +#include "mem.h" #define ASSERT(x) if (!(x)) { \ printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \ @@ -352,7 +353,7 @@ SpiceRect *region_dup_rects(const QRegion *rgn, uint32_t *num_rects) if (num_rects) { *num_rects = n; } - rects = (SpiceRect *)malloc(sizeof(SpiceRect)*n); + rects = spice_new(SpiceRect, n); for (i = 0; i < n; i++) { rects[i].left = boxes[i].x1; rects[i].top = boxes[i].y1; |