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
This commit is contained in:
Christopher Michael 2020-03-04 14:20:47 -05:00
parent 9ea61428db
commit 7a89b7711f
1 changed files with 6 additions and 2 deletions

View File

@ -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));
}