diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-06-11 10:26:19 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-06-11 10:27:47 -0700 |
commit | 178b95c486a1abcf2395157600dc1a2da7e67441 (patch) | |
tree | 6313208d7a1eca89f42952150b9431ab97b2bf12 /src/XShape.c | |
parent | d965a1a8ce9331d2aaf1c697a29455ad55171b36 (diff) | |
download | xorg-lib-libXext-178b95c486a1abcf2395157600dc1a2da7e67441.tar.gz |
Convert calls to Xmalloc arrays to use Xmallocarray instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/XShape.c')
-rw-r--r-- | src/XShape.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/XShape.c b/src/XShape.c index 15d754f..c51e5b9 100644 --- a/src/XShape.c +++ b/src/XShape.c @@ -36,6 +36,7 @@ in this Software without prior written authorization from The Open Group. #include <X11/extensions/shape.h> #include <X11/extensions/shapeproto.h> #include <limits.h> +#include "reallocarray.h" static XExtensionInfo _shape_info_data; static XExtensionInfo *shape_info = &_shape_info_data; @@ -463,8 +464,8 @@ XRectangle *XShapeGetRectangles ( rects = NULL; if (rep.nrects) { if (rep.nrects < (INT_MAX / sizeof (XRectangle))) { - xrects = Xmalloc (rep.nrects * sizeof (xRectangle)); - rects = Xmalloc (rep.nrects * sizeof (XRectangle)); + xrects = Xmallocarray (rep.nrects, sizeof (xRectangle)); + rects = Xmallocarray (rep.nrects, sizeof (XRectangle)); } else { xrects = NULL; rects = NULL; |