efl_ui_widget_common: Fix potential resource leak
authorChristopher Michael <cp.michael@samsung.com>
Tue, 12 Mar 2019 14:18:17 +0000 (10:18 -0400)
committerYeongjong Lee <yj34.lee@samsung.com>
Tue, 2 Apr 2019 03:45:17 +0000 (12:45 +0900)
commit5f46e2e6c55eb564e904863e20f2d2096c5d0b29
tree41229568284194ffd8be56f3a3cb7aa3e3f99a5b
parent728919e2b2b91a8fefa773d97326c346ab5d54eb
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
src/lib/elementary/efl_ui_widget_common.c