dri: Make it a little clearer that we're not dereferencing a NULL pointer

This commit is contained in:
nobled 2010-09-07 12:26:07 -04:00 committed by Kristian Høgsberg
parent 1b8c9fef11
commit 6561a64a69
1 changed files with 2 additions and 1 deletions

View File

@ -635,6 +635,7 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
__DRIcontext *shared, void *data) __DRIcontext *shared, void *data)
{ {
__DRIcontext *context; __DRIcontext *context;
const __GLcontextModes *modes = (config != NULL) ? &config->modes : NULL;
void *shareCtx = (shared != NULL) ? shared->driverPrivate : NULL; void *shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
gl_api mesa_api; gl_api mesa_api;
@ -663,7 +664,7 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
context->driDrawablePriv = NULL; context->driDrawablePriv = NULL;
context->loaderPrivate = data; context->loaderPrivate = data;
if (!(*screen->DriverAPI.CreateContext)(mesa_api, &config->modes, if (!(*screen->DriverAPI.CreateContext)(mesa_api, modes,
context, shareCtx) ) { context, shareCtx) ) {
free(context); free(context);
return NULL; return NULL;