From 75b362763cca8b6139582ad85e3b58f0b2e30a1c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 8 Oct 2013 15:02:44 -0400 Subject: [PATCH] glx: Only take a Pixmap reference if creating the GLXPixmap succeeded Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson --- glx/glxcmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }