mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 11:40:12 +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)
|
if (!others)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
if (!pWin->optional->inputMasks && !MakeInputMasks(pWin))
|
if (!pWin->optional->inputMasks && !MakeInputMasks(pWin))
|
||||||
return BadAlloc;
|
goto bail;
|
||||||
others->mask[mskidx] = mask;
|
others->mask[mskidx] = mask;
|
||||||
others->resource = FakeClientID(client->index);
|
others->resource = FakeClientID(client->index);
|
||||||
others->next = pWin->optional->inputMasks->inputClients;
|
others->next = pWin->optional->inputMasks->inputClients;
|
||||||
pWin->optional->inputMasks->inputClients = others;
|
pWin->optional->inputMasks->inputClients = others;
|
||||||
if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer) pWin))
|
if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer) pWin))
|
||||||
return BadAlloc;
|
goto bail;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
|
bail:
|
||||||
|
free(others);
|
||||||
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue