summaryrefslogtreecommitdiff
path: root/src/GetMoEv.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-06-04 23:30:43 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2018-12-08 10:06:42 -0800
commit6d1dc1f6169ebf0ba71785d461bd98129c65c862 (patch)
tree404077a4e254637baa658c474f5216a99538cdb9 /src/GetMoEv.c
parentbcf7b5aa06c23aee00af7999b58cb96a8571ac42 (diff)
Convert main src directory to use reallocarray()
Diffstat (limited to 'src/GetMoEv.c')
-rw-r--r--src/GetMoEv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/GetMoEv.c b/src/GetMoEv.c
index ad9c7727..d723f378 100644
--- a/src/GetMoEv.c
+++ b/src/GetMoEv.c
@@ -28,6 +28,7 @@ in this Software without prior written authorization from The Open Group.
#include <config.h>
#endif
#include "Xlibint.h"
+#include "reallocarray.h"
#include <limits.h>
XTimeCoord *XGetMotionEvents(
@@ -53,7 +54,7 @@ XTimeCoord *XGetMotionEvents(
}
if (rep.nEvents && (rep.nEvents < (INT_MAX / sizeof(XTimeCoord))))
- tc = Xmalloc(rep.nEvents * sizeof(XTimeCoord));
+ tc = Xmallocarray(rep.nEvents, sizeof(XTimeCoord));
if (tc == NULL) {
/* server returned either no events or a bad event count */
*nEvents = 0;