ecore_wl2: fix coverity issue. (Resource Leak)

Module is not freed when eina_module_load is failed.
Differential Revision: https://phab.enlightenment.org/D7152
This commit is contained in:
Hosang Kim 2018-10-10 08:22:57 +00:00 committed by Marcel Hollerbach
parent bc9ffbebb0
commit 185a1f739b
1 changed files with 8 additions and 1 deletions

View File

@ -82,7 +82,14 @@ _ecore_wl2_surface_modules_init(void)
{
Eina_Module *local_module = eina_module_new(path);
EINA_SAFETY_ON_NULL_RETURN_VAL(local_module, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_module_load(local_module), EINA_FALSE);
if (!eina_module_load(local_module))
{
ERR("Cannot load module %s", local_module->file);
eina_module_free(local_module);
local_module = NULL;
return EINA_FALSE;
}
return EINA_TRUE;
}
}