summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-12-11 00:46:22 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-12-18 16:51:45 -0800
commiteb750f8b5e14751d4c40b50499baec5d2ba79db9 (patch)
tree48791902f8ebe6f6422787285accb13d44e25b8a /xkb
parent1df4bd6011e110dcf0649b15bfffd4ab9e6961d6 (diff)
Check for failures from CreateNewResourceType
Make sure to check return value before setting bitmask flags. For most calls, just fails to init the extension. Since Xinput already calls FatalError() on initialization failure, so does failure to allocate Xinput's resource type. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 35f8d1cbd..c490f8b9f 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -6704,6 +6704,10 @@ XkbExtensionInit(void)
{
ExtensionEntry *extEntry;
+ RT_XKBCLIENT = CreateNewResourceType(XkbClientGone);
+ if (!RT_XKBCLIENT)
+ return;
+
if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors,
ProcXkbDispatch, SProcXkbDispatch,
NULL, StandardMinorOpcode))) {
@@ -6711,7 +6715,6 @@ XkbExtensionInit(void)
XkbEventBase = (unsigned char)extEntry->eventBase;
XkbErrorBase = (unsigned char)extEntry->errorBase;
XkbKeyboardErrorCode = XkbErrorBase+XkbKeyboard;
- RT_XKBCLIENT = CreateNewResourceType(XkbClientGone);
}
return;
}