[PATCH 17/19] glx: Catch another failure case in drawable creation

Adam Jackson ajax at redhat.com
Wed Aug 21 14:25:22 PDT 2013


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxcmds.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 9deadb7..0ab2ed5 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)) {
-- 
1.8.3.1



More information about the xorg-devel mailing list