summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-03-12 10:18:17 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2019-03-13 11:51:59 +0100
commitf60fef6f0fb7f0bedd24ceb1d7cf55967d30aac6 (patch)
tree449650aca541688ddeba6eac9052bf66d4e0e9ae
parent86cf4e5d7be0cdbdb51149c9b8fe9ea6e3e3d694 (diff)
efl_ui_widget_common: Fix potential resource leak
Coverity reports that we potentially leak the storage of 'tree_iterator' here because we allocate the space for it, but potentially juse return due to use of ELM_WIDGET_DATA_GET_OR_RETURN. To fix this, just move the allocation to after the above macro is called. Fixes Coverity CID1399088 @fix Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8314
-rw-r--r--src/lib/elementary/efl_ui_widget_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_widget_common.c b/src/lib/elementary/efl_ui_widget_common.c
index 519efe21bf..c83fd07c92 100644
--- a/src/lib/elementary/efl_ui_widget_common.c
+++ b/src/lib/elementary/efl_ui_widget_common.c
@@ -139,8 +139,8 @@ _only_widget(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNU
139EAPI Eina_Iterator* 139EAPI Eina_Iterator*
140efl_ui_widget_tree_widget_iterator(Efl_Ui_Widget *obj) 140efl_ui_widget_tree_widget_iterator(Efl_Ui_Widget *obj)
141{ 141{
142 Eina_Iterator *tree_iterator = efl_ui_widget_tree_iterator(obj);
143 ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL); 142 ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL);
143 Eina_Iterator *tree_iterator = efl_ui_widget_tree_iterator(obj);
144 144
145 return eina_iterator_filter_new(tree_iterator, _only_widget, NULL, NULL); 145 return eina_iterator_filter_new(tree_iterator, _only_widget, NULL, NULL);
146} 146}