eo: do not check this here
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Tue, 24 Mar 2020 14:45:22 +0000 (15:45 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 24 Mar 2020 21:54:58 +0000 (06:54 +0900)
as coverity points out, _obj_is_override is already dereferencing
obj->opt so this was the wrong spot to check this.

CID 1422014
CID 1422013

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11579

src/lib/eo/eo.c

index 8a6005e..060b076 100644 (file)
@@ -1255,10 +1255,9 @@ _eo_free(_Eo_Object *obj, Eina_Bool manual_free EINA_UNUSED)
           }
      }
 #endif
-   if (_obj_is_override(obj))
+   if (obj->opt && _obj_is_override(obj))
      {
-        if (obj->opt)
-          _vtable_free(obj->opt->vtable, &obj->klass->vtable);
+        _vtable_free(obj->opt->vtable, &obj->klass->vtable);
         EO_OPTIONAL_COW_SET(obj, vtable, NULL);
      }