aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xnest/Keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xnest/Keyboard.c')
-rw-r--r--xorg-server/hw/xnest/Keyboard.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xorg-server/hw/xnest/Keyboard.c b/xorg-server/hw/xnest/Keyboard.c
index ee3f68e3f..7ee7a7c3c 100644
--- a/xorg-server/hw/xnest/Keyboard.c
+++ b/xorg-server/hw/xnest/Keyboard.c
@@ -16,6 +16,10 @@ is" without express or implied warranty.
#include <xnest-config.h>
#endif
+#ifdef WIN32
+#include <X11/Xwindows.h>
+#endif
+
#include <X11/X.h>
#include <X11/Xproto.h>
#include <xcb/xcb_keysyms.h>
@@ -134,7 +138,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
max_keycode - min_keycode + 1,
&mapWidth);
len = (max_keycode - min_keycode + 1) * mapWidth;
- keymap = (KeySym *) malloc(len * sizeof(KeySym));
+ keymap = xallocarray(len, sizeof(KeySym));
for (i = 0; i < len; ++i)
keymap[i] = keymap64[i];
XFree(keymap64);