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
c1875ac25b
commit
daae5e5de1
|
@ -1607,14 +1607,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…
Reference in New Issue
Block a user