summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2013-10-08 15:02:44 -0400
committerAdam Jackson <ajax@redhat.com>2013-10-29 10:30:43 -0400
commit75b362763cca8b6139582ad85e3b58f0b2e30a1c (patch)
tree22cc385811c73d967f5a074cd25305344175382c /glx
parent7ecfab47eb221dbb996ea6c033348b8eceaeb893 (diff)
glx: Only take a Pixmap reference if creating the GLXPixmap succeeded
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 73e76ca9f..df738b147 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;
}