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 --- glx/glxext.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'glx') diff --git a/glx/glxext.c b/glx/glxext.c index 9f9c0ed1f..546d968fd 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -347,6 +347,9 @@ void GlxExtensionInit(void) __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone); __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone); + if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes) + return; + RegisterResourceName(__glXContextRes, "GLXContext"); RegisterResourceName(__glXDrawableRes, "GLXDrawable"); RegisterResourceName(__glXSwapBarrierRes, "GLXSwapBarrier"); -- cgit v1.2.3