aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2019-09-17 09:23:46 -0400
committerChris Michael <cp.michael@samsung.com>2019-09-17 09:23:46 -0400
commit21c7f95d0829ff484f04e622c724fc1134bdcf21 (patch)
tree8a567cd40f3c6e201b81031d3215b4ef72fec262
parentefl_ui_widget_factory: Fix resource leaks (diff)
downloadefl-21c7f95d0829ff484f04e622c724fc1134bdcf21.tar.gz
efl_ui_caching_factory: Fix resource leaks
Small patch to fix resource leaks pointed out by Coverity Fixes Coverity CID1404762
-rw-r--r--src/lib/elementary/efl_ui_caching_factory.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_caching_factory.c b/src/lib/elementary/efl_ui_caching_factory.c
index 33a44a013d..245830f161 100644
--- a/src/lib/elementary/efl_ui_caching_factory.c
+++ b/src/lib/elementary/efl_ui_caching_factory.c
@@ -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);