From abd086502123086ce3d1fba25c159bb022d2750f Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 8 Jul 2013 17:01:13 -0400 Subject: [PATCH] glx: Catch another failure case in drawable creation Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson --- glx/glxcmds.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 9deadb748..0ab2ed56b 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -515,6 +515,10 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client, pDraw, drawId, GLX_DRAWABLE_WINDOW, drawId, glxc->config); + if (!pGlxDraw) { + *error = BadAlloc; + return NULL; + } /* since we are creating the drawablePrivate, drawId should be new */ if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {