focus_manager: fix memory leaks
authorDerek Foreman <derek.foreman.samsung@gmail.com>
Tue, 15 Jan 2019 01:01:05 +0000 (19:01 -0600)
committerJiyoun Park <jy0703.park@samsung.com>
Wed, 16 Jan 2019 04:10:41 +0000 (13:10 +0900)
_set_a_without_b() makes a list clone internally, so cloning the list
first will leak a copy.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7622

src/lib/elementary/efl_ui_focus_manager_sub.c

index 7fb1383..eb05f97 100644 (file)
@@ -63,8 +63,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
    eina_iterator_free(borders);
 
    //elements which are not in the current border elements
-   tmp = eina_list_clone(pd->current_border);
-   tmp = _set_a_without_b(tmp , selection);
+   tmp = _set_a_without_b(pd->current_border, selection);
 
    EINA_LIST_FREE(tmp, node)
      {
@@ -73,8 +72,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
      }
 
    //set of the elements which are new without those which are currently registered
-   tmp = eina_list_clone(selection);
-   tmp = _set_a_without_b(tmp, pd->current_border);
+   tmp = _set_a_without_b(selection, pd->current_border);
 
    EINA_LIST_FREE(tmp, node)
      {