summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2011-03-28 20:13:11 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2011-04-04 15:41:47 +0300
commitdaae5e5de194757f7084f9b2b24353c34b961f19 (patch)
tree126fd81166a3086c87c8694e98f92bd332bbce3b
parentc1875ac25b7b730d464c98c4c151c35efd64a562 (diff)
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>
-rw-r--r--Xi/exevents.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5b207bc4b..18803c95e 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -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