ecore_con: destructor are always called when finalize return NULL.

Summary:
This prevent crash and double free during an invalid Ecore_Con_Eet failure
to initialize.

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10362
This commit is contained in:
Cedric BAIL 2019-10-11 08:51:43 -04:00 committed by Mike Blumenkrantz
parent dcb6380ab5
commit 1f1f0f75c0
1 changed files with 2 additions and 7 deletions

View File

@ -693,14 +693,9 @@ _ecore_con_eet_base_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
EOLIAN static Efl_Object *
_ecore_con_eet_base_efl_object_finalize(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
{
if (pd->server) return efl_finalize(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
if (!pd->server) return NULL;
eet_data_descriptor_free(pd->edd);
eet_data_descriptor_free(pd->matching);
eina_hash_free(pd->data_callbacks);
eina_hash_free(pd->raw_data_callbacks);
return NULL;
return efl_finalize(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
}
EOLIAN static void