summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2013-12-16 07:04:00 -0700
committerBrian Paul <[email protected]>2013-12-18 09:06:52 -0700
commitca3df5eeda1def6aa7e44fd136e2c17d3a061e87 (patch)
tree7b3ee5d50eb120bb26e69c5416a9604ad24c6375 /src/glx/dri2_glx.c
parent56c5ba8f92d372f6c36d1746e875bbba09b6b00f (diff)
glx: Add missing null check in dri2CreateDrawable
Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index bfeebed9dd6..309c1e7d733 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -366,6 +366,10 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
struct dri2_display *pdp;
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
+ dpyPriv = __glXInitialize(psc->base.dpy);
+ if (dpyPriv == NULL)
+ return NULL;
+
pdraw = calloc(1, sizeof(*pdraw));
if (!pdraw)
return NULL;
@@ -395,8 +399,6 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
}
DRI2CreateDrawable(psc->base.dpy, xDrawable);
-
- dpyPriv = __glXInitialize(psc->base.dpy);
pdp = (struct dri2_display *)dpyPriv->dri2Display;;
/* Create a new drawable */
pdraw->driDrawable =