From ebaf0ce575d3a3cdbf7663b9f5174ec18d905267 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 27 Dec 2012 05:26:14 +0000 Subject: [PATCH] xi2 leak-- SVN revision: 81724 --- src/lib/ecore_x/xlib/ecore_x_xi2.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lib/ecore_x/xlib/ecore_x_xi2.c b/src/lib/ecore_x/xlib/ecore_x_xi2.c index 5284b80aea..4e4300f2bd 100644 --- a/src/lib/ecore_x/xlib/ecore_x_xi2.c +++ b/src/lib/ecore_x/xlib/ecore_x_xi2.c @@ -75,6 +75,7 @@ _ecore_x_input_touch_info_clear(void) { info = EINA_INLIST_CONTAINER_GET(l, Ecore_X_Touch_Device_Info); l = eina_inlist_remove(l, l); + if (info->slot) free(info->slot); free(info); } @@ -155,8 +156,8 @@ _ecore_x_input_touch_index_clear(int devid, int idx) } } -static Ecore_X_Touch_Device_Info* -_ecore_x_input_touch_info_get(XIDeviceInfo* dev) +static Ecore_X_Touch_Device_Info * +_ecore_x_input_touch_info_get(XIDeviceInfo *dev) { int k; int *slot = NULL; @@ -168,11 +169,11 @@ _ecore_x_input_touch_info_get(XIDeviceInfo* dev) for (k = 0; k < dev->num_classes; k++) { - XIAnyClassInfo *class = dev->classes[k]; + XIAnyClassInfo *clas = dev->classes[k]; - if (class && (class->type == XITouchClass)) + if (clas && (clas->type == XITouchClass)) { - t = (XITouchClassInfo*)class; + t = (XITouchClassInfo *)clas; break; } } @@ -182,7 +183,7 @@ _ecore_x_input_touch_info_get(XIDeviceInfo* dev) info = calloc(1, sizeof(Ecore_X_Touch_Device_Info)); if (!info) return NULL; - slot = (int*)malloc(sizeof(int)*(t->num_touches + 1)); + slot = malloc(sizeof(int) * (t->num_touches + 1)); if (!slot) { free(info); @@ -193,7 +194,7 @@ _ecore_x_input_touch_info_get(XIDeviceInfo* dev) info->max_touch = t->num_touches + 1; info->mode = t->mode; info->name = dev->name; - memset(slot, -1, sizeof(int)*info->max_touch); + memset(slot, -1, sizeof(int) * info->max_touch); info->slot = slot; }