summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@vmware.com>2009-02-13 13:45:08 +0000
committerAlan Hourihane <alanh@vmware.com>2009-02-13 13:45:08 +0000
commita26c77ff432d2e85a2665fc36fca25143460c476 (patch)
tree9ce232fd78d5ec8d44bb2fd76c279572d0f60a2b
parenta38ca0063c91ef221f20bf0c4ac0dc84ce07d557 (diff)
glx: fix retval checks when failures occur for drawable creation.
-rw-r--r--glx/glxdri.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/glx/glxdri.c b/glx/glxdri.c
index 8fb90cbeb..fb9578243 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -647,7 +647,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
if (visual->vid == glxConfig->visualID)
break;
if (i == pScreen->numVisuals)
- return GL_FALSE;
+ return NULL;
context->hwContextID = FakeClientID(0);
@@ -656,6 +656,9 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->hwContextID, &hwContext);
__glXleaveServer(GL_FALSE);
+ if (!retval)
+ return NULL;
+
context->driContext =
screen->legacy->createNewContext(screen->driScreen,
config->driConfig,
@@ -707,6 +710,11 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
pDraw, &hwDrawable);
__glXleaveServer(GL_FALSE);
+ if (!retval) {
+ xfree(private);
+ return NULL;
+ }
+
/* The last argument is 'attrs', which is used with pbuffers which
* we currently don't support. */