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)
|
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…
Reference in New Issue