diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 207ad063f..c4105e26d 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -303,6 +303,10 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, (*screen->dri2->createNewContext)(screen->driScreen, config->driConfig, driShare, context); + if (context->driContext == NULL) { + xfree(context); + return NULL; + } return &context->base; }