summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-07-26 15:31:03 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2010-09-01 14:43:05 +1000
commitb5c9953bbf4ffd11f1a70d058c6d3feb2bd1bca8 (patch)
tree68f82528f1d5faf30ea01370c0d174d3766a8be6 /xkb
parent2e6d7174042cc8007e947b7d9fb54acc0ebe29d2 (diff)
xkb: Check if AddResource failed
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xkb/xkb.c b/xkb/xkb.c
index a82cc38cc..4105c1c6b 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -224,7 +224,8 @@ ProcXkbSelectEvents(ClientPtr client)
masks = XkbFindClientResource((DevicePtr)dev,client);
if (!masks){
XID id = FakeClientID(client->index);
- AddResource(id,RT_XKBCLIENT,dev);
+ if (!AddResource(id,RT_XKBCLIENT,dev))
+ return BadAlloc;
masks= XkbAddClientResource((DevicePtr)dev,client,id);
}
if (masks) {
@@ -5378,7 +5379,8 @@ ProcXkbPerClientFlags(ClientPtr client)
}
else if (want && (!interest)) {
XID id = FakeClientID(client->index);
- AddResource(id,RT_XKBCLIENT,dev);
+ if (!AddResource(id,RT_XKBCLIENT,dev))
+ return BadAlloc;
interest= XkbAddClientResource((DevicePtr)dev,client,id);
if (!interest)
return BadAlloc;