[PATCH] glx: Only take a Pixmap reference if creating the GLXPixmap succeeded

Adam Jackson ajax at redhat.com
Wed Oct 9 12:08:26 PDT 2013


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

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 73e76ca..df738b1 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1249,7 +1249,8 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen * pGlxScreen,
     err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId,
                               glxDrawableId, GLX_DRAWABLE_PIXMAP);
 
-    ((PixmapPtr) pDraw)->refcnt++;
+    if (err == Success)
+        ((PixmapPtr) pDraw)->refcnt++;
 
     return err;
 }
-- 
1.8.3.1



More information about the xorg-devel mailing list