mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-07 04:08:25 +02:00
render: fix memory leaks on XaceHook failure in resource creation
Same pattern for all hunks here: if Xace fails, free the allocated data. Assisted-by: Claude:claude-claude-opus-4-6 Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2205>
This commit is contained in:
parent
634247ef0c
commit
23e7de97c8
1 changed files with 15 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue