hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=c6cff4bef8e3bed8b74b9fb48301e4a7a4c5f55a

commit c6cff4bef8e3bed8b74b9fb48301e4a7a4c5f55a
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Sat Aug 27 23:42:15 2016 +0900

    fix memory corruption at free time.
    
    That list pointer could be corrupted because
    inside of the enventor_item_del(), the list head pointer could be modified.
---
 src/lib/enventor_smart.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index 2871086..414f3b3 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -94,8 +94,12 @@ static void
 _enventor_sub_items_free(Enventor_Object_Data *pd)
 {
    Enventor_Item *it;
-   EINA_LIST_FREE(pd->sub_its, it)
-     enventor_item_del(it);
+
+   while(pd->sub_its)
+     {
+        it = eina_list_data_get(pd->sub_its);
+        enventor_item_del(it);
+     }
    pd->sub_its = NULL;
 }
 

-- 


Reply via email to