summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2015-06-11 12:05:10 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-11 15:15:35 +0200
commit96d56fa9ec914d1de733ee9e3dce86ea4d2a7ced (patch)
tree80cd044e6dbbe9e2d15a8587c80ebe181fa61391
parent919750f27bbe5c07539d775a03b87d943dc0ae8f (diff)
transit: add NULL check for memory allocation.
Summary: Adding Null checking when allocate memory. Reviewers: Hermet, seoz Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2662 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_transit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/elm_transit.c b/src/lib/elm_transit.c
index f1f0eb2ab..ade939090 100644
--- a/src/lib/elm_transit.c
+++ b/src/lib/elm_transit.c
@@ -117,6 +117,11 @@ _transit_obj_data_save(Evas_Object *obj)
117 } 117 }
118 118
119 obj_data = ELM_NEW(Elm_Transit_Obj_Data); 119 obj_data = ELM_NEW(Elm_Transit_Obj_Data);
120 if (!obj_data)
121 {
122 ERR("Failed to allocate memory");
123 return;
124 }
120 125
121 evas_object_geometry_get(obj, &obj_data->state.x, &obj_data->state.y, 126 evas_object_geometry_get(obj, &obj_data->state.x, &obj_data->state.y,
122 &obj_data->state.w, &obj_data->state.h); 127 &obj_data->state.w, &obj_data->state.h);
@@ -1119,7 +1124,7 @@ _transit_effect_zoom_op(Elm_Transit_Effect *effect, Elm_Transit *transit , doubl
1119 EINA_LIST_FOREACH(transit->objs, elist, obj) 1124 EINA_LIST_FOREACH(transit->objs, elist, obj)
1120 { 1125 {
1121 obj_data = evas_object_data_get(obj, _transit_key); 1126 obj_data = evas_object_data_get(obj, _transit_key);
1122 if (obj_data->state.map_enabled) 1127 if (obj_data && obj_data->state.map_enabled)
1123 { 1128 {
1124 base_map = obj_data->state.map; 1129 base_map = obj_data->state.map;
1125 if (!base_map) return; 1130 if (!base_map) return;
@@ -2341,7 +2346,7 @@ _transit_effect_rotation_op(Elm_Transit_Effect *effect, Elm_Transit *transit, do
2341 EINA_LIST_FOREACH(transit->objs, elist, obj) 2346 EINA_LIST_FOREACH(transit->objs, elist, obj)
2342 { 2347 {
2343 obj_data = evas_object_data_get(obj, _transit_key); 2348 obj_data = evas_object_data_get(obj, _transit_key);
2344 if (obj_data->state.map_enabled) 2349 if (obj_data && obj_data->state.map_enabled)
2345 { 2350 {
2346 base_map = obj_data->state.map; 2351 base_map = obj_data->state.map;
2347 if (!base_map) return; 2352 if (!base_map) return;