tasn pushed a commit to branch efl-1.10.

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

commit d437afbb7948a7fbd9be78f4c48f24c9b610b555
Author: Thiep Ha <thie...@gmail.com>
Date:   Fri Jul 25 16:06:37 2014 +0100

    Evas textblock: Fix memory leak
    
    Summary:
    In evas_textblock_cursor_word_end function, the breaks' memory is allocated 
but not freed when cursor position is equal to text length.
    Fix: Remove memory allocating.
    
    @fix
    
    Reviewers: raster, tasn
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1225
---
 src/lib/evas/canvas/evas_object_textblock.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 384a194..476dc82 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -7218,6 +7218,9 @@ evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur)
 
    size_t len = eina_ustrbuf_length_get(cur->node->unicode);
 
+   if (cur->pos == len)
+      return EINA_TRUE;
+
    text = eina_ustrbuf_string_get(cur->node->unicode);
 
      {
@@ -7226,9 +7229,6 @@ evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur)
         set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks);
      }
 
-   if (cur->pos == len)
-      return EINA_TRUE;
-
    for (i = cur->pos; text[i] && _is_white(text[i]) && (BREAK_AFTER(i)) ; i++);
 
    for ( ; text[i] ; i++)

-- 


Reply via email to