summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-13 11:05:33 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-13 11:35:37 +1000
commit07d7fc323367ac93c3c26eaf130284e31aa961ea (patch)
tree87484212f46ff813a5728ef7b11dc0158a4744ce
parent753fb6afb13a7ce154cd24261eadb56c3f4243c5 (diff)
Plug memory leak in XIHierarchyEvent copy.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/XExtInt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index b66c797..e06cc91 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1501,11 +1501,11 @@ wireToHierarchyChangedEvent(xXIHierarchyEvent *in, XGenericEventCookie *cookie)
int i;
XIHierarchyInfo *info_out;
xXIHierarchyInfo *info_in;
- XIHierarchyEvent *out = malloc(sizeof(XIHierarchyEvent));
+ XIHierarchyEvent *out;
- cookie->data = out;
+ cookie->data = out = malloc(sizeof(XIHierarchyEvent) + in->num_info * sizeof(XIHierarchyInfo));;
- out->info = Xmalloc(in->num_info * sizeof(XIHierarchyInfo));
+ out->info = (XIHierarchyInfo*)&out[1];
out->type = in->type;
out->extension = in->extension;
out->evtype = in->evtype;