summaryrefslogtreecommitdiff
path: root/Xi/listdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/listdev.c')
-rw-r--r--Xi/listdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Xi/listdev.c b/Xi/listdev.c
index 9a5a189de..48c1e059b 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -338,6 +338,7 @@ ProcXListInputDevices(ClientPtr client)
REQUEST_SIZE_MATCH(xListInputDevicesReq);
+ memset(&rep, 0, sizeof(xListInputDevicesReply));
rep.repType = X_Reply;
rep.RepType = X_ListInputDevices;
rep.length = 0;
@@ -379,7 +380,7 @@ ProcXListInputDevices(ClientPtr client)
}
total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
- devbuf = (char *)xalloc(total_length);
+ devbuf = (char *)xcalloc(1, total_length);
classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
namebuf = classbuf + size;
savbuf = devbuf;