diff options
author | Pauli Nieminen <ext-pauli.nieminen@nokia.com> | 2010-07-26 15:31:03 +0300 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-09-01 14:43:05 +1000 |
commit | b5c9953bbf4ffd11f1a70d058c6d3feb2bd1bca8 (patch) | |
tree | 68f82528f1d5faf30ea01370c0d174d3766a8be6 /xkb | |
parent | 2e6d7174042cc8007e947b7d9fb54acc0ebe29d2 (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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |