forked from enlightenment/efl
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:
parent
bb7353b450
commit
21c7f95d08
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue