ecore_x - axis events - if event struct alloc fails, free axis data
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 21 Apr 2015 01:32:40 +0000 (10:32 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 21 Apr 2015 01:32:40 +0000 (10:32 +0900)
this frees the axis data coming in if struct alloc fails - should
basically never happen, but if it does we don't lose axis data as
caller asumes this data will be freed in the event

related to CID 1256115

src/lib/ecore_x/xlib/ecore_x_events.c

index 25d8fa21d60568a2a285553bf6797b164ee7af32..8ab79a4582c4075e1c8c17060cb1a1a2d4f24789 100644 (file)
@@ -291,7 +291,11 @@ _ecore_x_axis_update(Ecore_Window window,
    int i;
 
    e = malloc(sizeof(Ecore_Event_Axis_Update));
-   if (!e) return;
+   if (!e)
+     {
+        if (axis) free(axis);
+        return;
+     }
 
    e->window = window;
    e->event_window = event_window;