cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=11ac6b145d826159b6d336964a965d330127c4cb

commit 11ac6b145d826159b6d336964a965d330127c4cb
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Wed Dec 2 12:27:25 2015 -0800

    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();

-- 


Reply via email to