summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2020-03-04 14:20:47 -0500
committerChristopher Michael <devilhorns@comcast.net>2020-03-04 14:20:47 -0500
commit7a89b7711f5dcd1c7f177634730b64cfbc9d1c06 (patch)
tree207c196f13c660f953a1378ba57540022aaa5bde
parent9ea61428db639a8e6d666885fe245e9f753bbe7c (diff)
downloadefl-7a89b7711f5dcd1c7f177634730b64cfbc9d1c06.tar.gz
evas: Fix dereferenceing null pointer
Coverity reports a forward null here. If we do not get obj from efl_data_scope_get then we should return. Also fixes some formatting Fixes CID1420216
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c
index fd904f7708..c4a4b44f51 100644
--- a/src/lib/evas/canvas/evas_object_intercept.c
+++ b/src/lib/evas/canvas/evas_object_intercept.c
@@ -15,8 +15,12 @@ static void evas_object_intercept_deinit(Evas_Object *eo_obj);
static void
evas_object_intercept_init(Evas_Object *eo_obj)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
- if (!obj || !obj->interceptors)
+ Evas_Object_Protected_Data *obj;
+
+ obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ if (!obj) return;
+
+ if (!obj->interceptors)
obj->interceptors = calloc(1, sizeof(Evas_Intercept_Func));
}