ecore: Check that eo_data_scope_get returns valid Ecore_Timer_Data
authorChris Michael <cp.michael@samsung.com>
Fri, 5 Sep 2014 15:35:21 +0000 (11:35 -0400)
committerChris Michael <cp.michael@samsung.com>
Fri, 5 Sep 2014 15:39:36 +0000 (11:39 -0400)
before trying to use it

eo_data_scope_get Could return NULL if it does not find valid
ecore_timer_data on this object. We should check that return before
just Assuming that timer data is valid.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore/ecore_timer.c

index 17ab042..ff8e8b7 100644 (file)
@@ -436,6 +436,8 @@ _ecore_timer_del(Ecore_Timer *obj)
 {
    Ecore_Timer_Data *timer = eo_data_scope_get(obj, MY_CLASS);
 
+   EINA_SAFETY_ON_NULL_RETURN_VAL(timer, NULL);
+
    if (timer->frozen && !timer->references)
      {
         void *data = timer->data;