diff options
Diffstat (limited to 'src/GetPntMap.c')
-rw-r--r-- | src/GetPntMap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/GetPntMap.c b/src/GetPntMap.c index 07625f8a..4219a110 100644 --- a/src/GetPntMap.c +++ b/src/GetPntMap.c @@ -29,6 +29,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> #ifdef MIN /* some systems define this in <sys/param.h> */ @@ -112,8 +113,7 @@ XGetKeyboardMapping (Display *dpy, nkeysyms = rep.length; if (nkeysyms > 0) { if (nkeysyms < (INT_MAX / sizeof (KeySym))) { - nbytes = nkeysyms * sizeof (KeySym); - mapping = Xmalloc (nbytes); + mapping = Xmallocarray (nkeysyms, sizeof (KeySym)); } if (! mapping) { _XEatDataWords(dpy, rep.length); |