tasn pushed a commit to branch master.

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

commit 808202e6afe648d6a848db053ca9e823208ddeff
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 fa4118b..58cc476 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -7378,6 +7378,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);
 
      {
@@ -7386,9 +7389,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