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)) {