bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=509ad380832736361e01510991d27c67f8d10664

commit 509ad380832736361e01510991d27c67f8d10664
Author: Marcel Hollerbach <[email protected]>
Date:   Fri Jan 31 13:51:38 2020 +0100

    evas_object_grid: fix leaking of pointer
    
    priv->children was leaked to a freed pointer here.
    This is now fixed.
---
 src/lib/evas/canvas/evas_object_grid.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_grid.c 
b/src/lib/evas/canvas/evas_object_grid.c
index 72cb176ecc..cecff65584 100644
--- a/src/lib/evas/canvas/evas_object_grid.c
+++ b/src/lib/evas/canvas/evas_object_grid.c
@@ -176,16 +176,14 @@ static void
 _evas_object_grid_smart_del(Evas_Object *o)
 {
    EVAS_OBJECT_GRID_DATA_GET(o, priv);
-   Eina_List *l;
 
-   l = priv->children;
-   while (l)
+   while (priv->children)
      {
-       Evas_Object_Grid_Option *opt = l->data;
-       _evas_object_grid_child_disconnect(o, opt->obj);
-       _evas_object_grid_option_del(opt->obj);
-       free(opt);
-       l = eina_list_remove_list(l, l);
+        Evas_Object_Grid_Option *opt = priv->children->data;
+        _evas_object_grid_child_disconnect(o, opt->obj);
+        _evas_object_grid_option_del(opt->obj);
+        free(opt);
+        priv->children = eina_list_remove_list(priv->children, priv->children);
      }
 
    _evas_object_grid_parent_sc->del(o);
@@ -352,7 +350,7 @@ _evas_grid_pack(Eo *o, Evas_Grid_Data *priv, Evas_Object 
*child, int x, int y, i
      }
    // FIXME: we could keep a changed list
    evas_object_smart_changed(o);
-  
+
    return EINA_TRUE;
 }
 
@@ -385,7 +383,7 @@ _evas_grid_unpack(Eo *o, Evas_Grid_Data *priv, Evas_Object 
*child)
    _evas_object_grid_remove_opt(priv, opt);
    evas_object_smart_member_del(child);
    free(opt);
-  
+
    return EINA_TRUE;
 }
 

-- 


Reply via email to