eo: temporary prevent segfault.

In some case, detected during eo test suite, the vtable does fail to
be fully assigned, but it is still being assigned as the new vtable.
Of course when later destroying it, it has already been freed. Leading
to a double free.
This commit is contained in:
Cedric BAIL 2017-08-07 10:32:19 -07:00
parent f7278719c1
commit b7840d9177
1 changed files with 2 additions and 0 deletions

View File

@ -1642,6 +1642,8 @@ efl_object_override(Eo *eo_id, const Efl_Object_Ops *ops)
{
// FIXME: Maybe leaking some chain stuff from copy above?
ERR("Failed to override functions for %p", eo_id);
if (obj->opt->vtable == vtable)
EO_OPTIONAL_COW_SET(obj, vtable, NULL);
free(vtable);
goto err;
}