glx: fix retval checks when failures occur for drawable creation.

This commit is contained in:
Alan Hourihane 2009-02-13 13:45:08 +00:00
parent a38ca0063c
commit a26c77ff43

View File

@ -647,7 +647,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
if (visual->vid == glxConfig->visualID) if (visual->vid == glxConfig->visualID)
break; break;
if (i == pScreen->numVisuals) if (i == pScreen->numVisuals)
return GL_FALSE; return NULL;
context->hwContextID = FakeClientID(0); context->hwContextID = FakeClientID(0);
@ -656,6 +656,9 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->hwContextID, &hwContext); context->hwContextID, &hwContext);
__glXleaveServer(GL_FALSE); __glXleaveServer(GL_FALSE);
if (!retval)
return NULL;
context->driContext = context->driContext =
screen->legacy->createNewContext(screen->driScreen, screen->legacy->createNewContext(screen->driScreen,
config->driConfig, config->driConfig,
@ -707,6 +710,11 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
pDraw, &hwDrawable); pDraw, &hwDrawable);
__glXleaveServer(GL_FALSE); __glXleaveServer(GL_FALSE);
if (!retval) {
xfree(private);
return NULL;
}
/* The last argument is 'attrs', which is used with pbuffers which /* The last argument is 'attrs', which is used with pbuffers which
* we currently don't support. */ * we currently don't support. */