diff --git a/render/render.c b/render/render.c index fde156593..1efe11862 100644 --- a/render/render.c +++ b/render/render.c @@ -931,8 +931,10 @@ ProcRenderCreateGlyphSet(ClientPtr client) /* security creation/labeling check */ rc = XaceHookResourceAccess(client, stuff->gsid, GlyphSetType, glyphSet, X11_RESTYPE_NONE, NULL, DixCreateAccess); - if (rc != Success) + if (rc != Success) { + FreeGlyphSet(glyphSet, (XID) 0); return rc; + } if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet)) return BadAlloc; return Success; @@ -1866,8 +1868,10 @@ ProcRenderCreateSolidFill(ClientPtr client) /* security creation/labeling check */ error = XaceHookResourceAccess(client, stuff->pid, PictureType, pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess); - if (error != Success) + if (error != Success) { + FreePicture(pPicture, (XID) 0); return error; + } if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; @@ -1905,8 +1909,10 @@ ProcRenderCreateLinearGradient(ClientPtr client) /* security creation/labeling check */ error = XaceHookResourceAccess(client, stuff->pid, PictureType, pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess); - if (error != Success) + if (error != Success) { + FreePicture(pPicture, (XID) 0); return error; + } if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; @@ -1945,8 +1951,10 @@ ProcRenderCreateRadialGradient(ClientPtr client) /* security creation/labeling check */ error = XaceHookResourceAccess(client, stuff->pid, PictureType, pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess); - if (error != Success) + if (error != Success) { + FreePicture(pPicture, (XID) 0); return error; + } if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; @@ -1984,8 +1992,10 @@ ProcRenderCreateConicalGradient(ClientPtr client) /* security creation/labeling check */ error = XaceHookResourceAccess(client, stuff->pid, PictureType, pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess); - if (error != Success) + if (error != Success) { + FreePicture(pPicture, (XID) 0); return error; + } if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success;