efl_ui_caching_factory: Fix resource leaks

Small patch to fix resource leaks pointed out by Coverity

Fixes Coverity CID1404762
This commit is contained in:
Chris Michael 2019-09-17 09:23:46 -04:00
parent bb7353b450
commit 21c7f95d08
1 changed files with 10 additions and 2 deletions

View File

@ -199,7 +199,11 @@ _efl_ui_caching_factory_efl_ui_factory_create(Eo *obj,
r->factory = efl_ref(obj);
all = calloc(1, sizeof (Eina_Future *));
if (!all) return efl_loop_future_rejected(obj, ENOMEM);
if (!all)
{
free(r);
return efl_loop_future_rejected(obj, ENOMEM);
}
EINA_ITERATOR_FOREACH(models, model)
{
@ -209,7 +213,11 @@ _efl_ui_caching_factory_efl_ui_factory_create(Eo *obj,
.data = r);
all = realloc(all, (count + 1) * sizeof (Eina_Future *));
if (!all) return efl_loop_future_rejected(obj, ENOMEM);
if (!all)
{
free(r);
return efl_loop_future_rejected(obj, ENOMEM);
}
}
eina_iterator_free(models);