aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxdriswrast.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx/glxdriswrast.c')
-rw-r--r--xorg-server/glx/glxdriswrast.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c
index 26936c3dd..434653e70 100644
--- a/xorg-server/glx/glxdriswrast.c
+++ b/xorg-server/glx/glxdriswrast.c
@@ -334,6 +334,13 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
config->driConfig,
private);
+ if (!private->driDrawable)
+ {
+ FreeGC(private->gc, (GContext)0);
+ FreeGC(private->swapgc, (GContext)0);
+ free(private);
+ return NULL;
+ }
return &private->base;
}