summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-12-27 05:26:14 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-12-27 05:26:14 +0000
commitebaf0ce575d3a3cdbf7663b9f5174ec18d905267 (patch)
treed0cbfaf4544432c6b1a202416624ebdc4601a065 /src
parent2f1b5888b81a9f4ced4bf4337fc9054da882af5d (diff)
xi2 leak--
SVN revision: 81724
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_xi2.c15
1 files 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)
75 { 75 {
76 info = EINA_INLIST_CONTAINER_GET(l, Ecore_X_Touch_Device_Info); 76 info = EINA_INLIST_CONTAINER_GET(l, Ecore_X_Touch_Device_Info);
77 l = eina_inlist_remove(l, l); 77 l = eina_inlist_remove(l, l);
78 if (info->slot) free(info->slot);
78 free(info); 79 free(info);
79 } 80 }
80 81
@@ -155,8 +156,8 @@ _ecore_x_input_touch_index_clear(int devid, int idx)
155 } 156 }
156} 157}
157 158
158static Ecore_X_Touch_Device_Info* 159static Ecore_X_Touch_Device_Info *
159_ecore_x_input_touch_info_get(XIDeviceInfo* dev) 160_ecore_x_input_touch_info_get(XIDeviceInfo *dev)
160{ 161{
161 int k; 162 int k;
162 int *slot = NULL; 163 int *slot = NULL;
@@ -168,11 +169,11 @@ _ecore_x_input_touch_info_get(XIDeviceInfo* dev)
168 169
169 for (k = 0; k < dev->num_classes; k++) 170 for (k = 0; k < dev->num_classes; k++)
170 { 171 {
171 XIAnyClassInfo *class = dev->classes[k]; 172 XIAnyClassInfo *clas = dev->classes[k];
172 173
173 if (class && (class->type == XITouchClass)) 174 if (clas && (clas->type == XITouchClass))
174 { 175 {
175 t = (XITouchClassInfo*)class; 176 t = (XITouchClassInfo *)clas;
176 break; 177 break;
177 } 178 }
178 } 179 }
@@ -182,7 +183,7 @@ _ecore_x_input_touch_info_get(XIDeviceInfo* dev)
182 info = calloc(1, sizeof(Ecore_X_Touch_Device_Info)); 183 info = calloc(1, sizeof(Ecore_X_Touch_Device_Info));
183 if (!info) return NULL; 184 if (!info) return NULL;
184 185
185 slot = (int*)malloc(sizeof(int)*(t->num_touches + 1)); 186 slot = malloc(sizeof(int) * (t->num_touches + 1));
186 if (!slot) 187 if (!slot)
187 { 188 {
188 free(info); 189 free(info);
@@ -193,7 +194,7 @@ _ecore_x_input_touch_info_get(XIDeviceInfo* dev)
193 info->max_touch = t->num_touches + 1; 194 info->max_touch = t->num_touches + 1;
194 info->mode = t->mode; 195 info->mode = t->mode;
195 info->name = dev->name; 196 info->name = dev->name;
196 memset(slot, -1, sizeof(int)*info->max_touch); 197 memset(slot, -1, sizeof(int) * info->max_touch);
197 info->slot = slot; 198 info->slot = slot;
198 } 199 }
199 200