summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2013-07-08 17:01:13 -0400
committerAdam Jackson <ajax@redhat.com>2013-09-11 14:37:33 -0400
commitabd086502123086ce3d1fba25c159bb022d2750f (patch)
tree819396beb26aaa39b6286992cee163d5d4c19cbd /glx
parentc3c976f54c3c282d6fa6c8360688e036bc43d210 (diff)
glx: Catch another failure case in drawable creation
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c4
1 files changed, 4 insertions, 0 deletions
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)) {