aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2019-09-17 09:21:15 -0400
committerChris Michael <cp.michael@samsung.com>2019-09-17 09:21:15 -0400
commitbb7353b450b96dc3153af1e7934019ad2bf16223 (patch)
treea043cd2d3876480dd929360ce5cbb5cb82bc1714
parentevas_vg_load_svg: Change strtod to eina_convert_strtod_c for locale issue (diff)
downloadefl-bb7353b450b96dc3153af1e7934019ad2bf16223.tar.gz
efl_ui_widget_factory: Fix resource leaks
Small patch to fix resource leaks pointed out by Coverity Fixes Coverity CID1404766
-rw-r--r--src/lib/elementary/efl_ui_widget_factory.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c
index 0579dc4a51..c9d5759744 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -186,7 +186,11 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
r->factory = efl_ref(obj);
f = calloc(count + 1, sizeof (Eina_Future *));
- if (!f) return efl_loop_future_rejected(obj, ENOMEM);
+ if (!f)
+ {
+ free(r);
+ return efl_loop_future_rejected(obj, ENOMEM);
+ }
EINA_ITERATOR_FOREACH(models, model)
{
@@ -195,7 +199,11 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
.free = _efl_ui_widget_factory_single_cleanup);
f = realloc(f, (count + 1) * sizeof (Eina_Future *));
- if (!f) return efl_loop_future_rejected(obj, ENOMEM);
+ if (!f)
+ {
+ free(r);
+ return efl_loop_future_rejected(obj, ENOMEM);
+ }
}
eina_iterator_free(models);