From eb750f8b5e14751d4c40b50499baec5d2ba79db9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 11 Dec 2009 00:46:22 -0800 Subject: 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 Reviewed-by: Keith Packard --- Xi/extinit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Xi') diff --git a/Xi/extinit.c b/Xi/extinit.c index 0c1291903..372f77f3b 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -1270,6 +1270,8 @@ XInputExtensionInit(void) XIVersion = thisversion; MakeDeviceTypeAtoms(); RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone); + if (!RT_INPUTCLIENT) + FatalError("Failed to add resource type for XI.\n"); RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT"); FixExtensionEvents(extEntry); ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch; -- cgit v1.2.3