diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-06-04 23:30:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2018-12-08 10:06:42 -0800 |
commit | 6d1dc1f6169ebf0ba71785d461bd98129c65c862 (patch) | |
tree | 404077a4e254637baa658c474f5216a99538cdb9 /src/PolyReg.c | |
parent | bcf7b5aa06c23aee00af7999b58cb96a8571ac42 (diff) | |
download | xorg-lib-libX11-6d1dc1f6169ebf0ba71785d461bd98129c65c862.tar.gz |
Convert main src directory to use reallocarray()
Diffstat (limited to 'src/PolyReg.c')
-rw-r--r-- | src/PolyReg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/PolyReg.c b/src/PolyReg.c index 7266d3b0..0884e1ea 100644 --- a/src/PolyReg.c +++ b/src/PolyReg.c @@ -55,6 +55,7 @@ SOFTWARE. #include "Xutil.h" #include <X11/Xregion.h> #include "poly.h" +#include "reallocarray.h" /* * InsertEdgeInET @@ -409,7 +410,7 @@ static int PtsToRegion( numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1; - if (!(reg->rects = Xrealloc(reg->rects, sizeof(BOX) * numRects))) { + if (!(reg->rects = Xreallocarray(reg->rects, numRects, sizeof(BOX)))) { Xfree(prevRects); return(0); } @@ -519,7 +520,7 @@ XPolygonRegion( if (Count < 2) return region; - if (! (pETEs = Xmalloc(sizeof(EdgeTableEntry) * Count))) { + if (! (pETEs = Xmallocarray(Count, sizeof(EdgeTableEntry)))) { XDestroyRegion(region); return (Region) NULL; } |