From c6cff4bef8e3bed8b74b9fb48301e4a7a4c5f55a Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Sat, 27 Aug 2016 23:42:15 +0900 Subject: [PATCH] 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; }