[Mesa-dev] [PATCH 5/5] glx: Add missing null check in dri2CreateDrawable
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Wed Dec 11 01:06:01 PST 2013
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/glx/dri2_glx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index bfeebed..e553004 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -397,6 +397,12 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
DRI2CreateDrawable(psc->base.dpy, xDrawable);
dpyPriv = __glXInitialize(psc->base.dpy);
+ if (dpyPriv == NULL) {
+ DRI2DestroyDrawable(psc->base.dpy, xDrawable);
+ free(pdraw);
+ return NULL;
+ }
+
pdp = (struct dri2_display *)dpyPriv->dri2Display;;
/* Create a new drawable */
pdraw->driDrawable =
--
1.8.1.2
More information about the mesa-dev
mailing list