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
This commit is contained in:
Thiep Ha 2014-07-25 16:06:37 +01:00 committed by Tom Hacohen
parent 0cc5f5c94d
commit 808202e6af
1 changed files with 3 additions and 3 deletions

View File

@ -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++)