mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 04:40:02 +01:00
xi: fix memory leak in AddExtensionClient
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
This commit is contained in:
parent
3468d4dae6
commit
9e526a39e0
1 changed files with 6 additions and 2 deletions
|
|
@ -1632,14 +1632,18 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx)
|
|||
if (!others)
|
||||
return BadAlloc;
|
||||
if (!pWin->optional->inputMasks && !MakeInputMasks(pWin))
|
||||
return BadAlloc;
|
||||
goto bail;
|
||||
others->mask[mskidx] = mask;
|
||||
others->resource = FakeClientID(client->index);
|
||||
others->next = pWin->optional->inputMasks->inputClients;
|
||||
pWin->optional->inputMasks->inputClients = others;
|
||||
if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer) pWin))
|
||||
return BadAlloc;
|
||||
goto bail;
|
||||
return Success;
|
||||
|
||||
bail:
|
||||
free(others);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue