aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiquerydevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/xiquerydevice.c')
-rw-r--r--xorg-server/Xi/xiquerydevice.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c
index 8b5421130..a768d499c 100644
--- a/xorg-server/Xi/xiquerydevice.c
+++ b/xorg-server/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;