hermet pushed a commit to branch master.

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

commit f9ae39ef52b33c1af2c81b864a1f77657fd8e6d9
Author: Hermet Park <chuneon.p...@samsung.com>
Date:   Mon Apr 13 14:43:00 2020 +0900

    evas text: fix memory leak.
    
    Summary: free used memory properly.
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D11691
---
 src/lib/evas/canvas/evas_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index ebd66998b4..757f3e47cd 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -125,7 +125,9 @@ _markup_to_utf8(Eina_Content *from, const char *to_type)
 {
    Eina_Slice slice = eina_content_data_get(from);
    char *utf8 = evas_textblock_text_markup_to_utf8(NULL, slice.mem);
-   return eina_content_new((Eina_Slice)EINA_SLICE_STR_FULL(utf8), to_type);
+   Eina_Content *ret = eina_content_new((Eina_Slice)EINA_SLICE_STR_FULL(utf8), 
to_type);
+   free(utf8);
+   return ret;
 }
 
 static Eina_Content*
@@ -133,7 +135,9 @@ _utf8_to_markup(Eina_Content *from, const char *to_type)
 {
    Eina_Slice slice = eina_content_data_get(from);
    char *markup = evas_textblock_text_utf8_to_markup(NULL, slice.mem);
-   return eina_content_new((Eina_Slice)EINA_SLICE_STR_FULL(markup), to_type);
+   Eina_Content *ret = 
eina_content_new((Eina_Slice)EINA_SLICE_STR_FULL(markup), to_type);
+   free(markup);
+   return ret;
 }
 
 EAPI int

-- 


Reply via email to