diff options
Diffstat (limited to 'Xi/xiquerydevice.c')
-rw-r--r-- | Xi/xiquerydevice.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index fdd2c051d..f8d6c13fa 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -107,8 +107,10 @@ ProcXIQueryDevice(ClientPtr client) } info = calloc(1, len); - if (!info) + if (!info) { + free(skip); return BadAlloc; + } memset(&rep, 0, sizeof(xXIQueryDeviceReply)); rep.repType = X_Reply; @@ -153,8 +155,9 @@ ProcXIQueryDevice(ClientPtr client) } } + len = rep.length * 4; WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); - WriteToClient(client, rep.length * 4, ptr); + WriteToClient(client, len, ptr); free(ptr); free(skip); return rc; |