From 11ac6b145d826159b6d336964a965d330127c4cb Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 2 Dec 2015 12:27:25 -0800 Subject: [PATCH] evas: fix double free. The ownership of this list and its content belong to the iterator. This code was actively double freeing and our test suite doesn't crash or have any issue... Well actually it was complaining that the list had error, but due to our other false positive test that do trigger eina log, we continuously ignored this error. NOTE: The fact that the test rely also on the container of the iterator instead of the iterator itself is not that great to. I kind of feel bad now for having allowed access to the container. We should have been able to allow changing the logic to generate those rectangle step after step instead of in one go. Now this seems difficult. --- src/tests/evas/evas_test_textblock.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index a14f599..b529fcb 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2429,10 +2429,6 @@ START_TEST(evas_textblock_geometries) fail_if((tr->x != tr2->x) || (tr->y != tr2->y) || (tr->w != tr2->w) || (tr->h != tr2->h)); - EINA_LIST_FREE(rects, tr) - free(tr); - EINA_LIST_FREE(rects2, tr2) - free(tr2); eina_iterator_free(it); eina_iterator_free(it2); @@ -2542,10 +2538,6 @@ START_TEST(evas_textblock_geometries) tr3 = eina_list_nth(rects, 3); fail_if((tr2->x != tr3->x)); - EINA_LIST_FREE(rects, tr) - free(tr); - EINA_LIST_FREE(rects2, tr2) - free(tr2); eina_iterator_free(it); eina_iterator_free(it2); @@ -2561,8 +2553,6 @@ START_TEST(evas_textblock_geometries) fail_if(eina_list_count(rects) != 2); - EINA_LIST_FREE(rects, tr) - free(tr); eina_iterator_free(it); /* Same run different styles */ @@ -2576,8 +2566,6 @@ START_TEST(evas_textblock_geometries) fail_if(eina_list_count(rects) != 3); - EINA_LIST_FREE(rects, tr) - free(tr); eina_iterator_free(it); /* Bidi text with a few back and forth from bidi. */ @@ -2592,8 +2580,6 @@ START_TEST(evas_textblock_geometries) ck_assert_int_eq(eina_list_count(rects), 3); - EINA_LIST_FREE(rects, tr) - free(tr); eina_iterator_free(it); END_TB_TEST(); -- 2.7.4