hermet pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=1baec2473b02fae0b15e7891aac523af95e5725a

commit 1baec2473b02fae0b15e7891aac523af95e5725a
Author: Vaibhav Gupta <[email protected]>
Date:   Wed Apr 22 16:06:14 2015 +0900

    Genlist: Fix for memory leak
    
    Summary:
    Fix memory leak in
    API _elm_genlist_item_elm_interface_atspi_accessible_name_get()
    added free after _elm_util_mkup_to_text.
    
    @fix
    
    Reviewers: raster, singh.amitesh, Hermet
    
    Reviewed By: Hermet
    
    Subscribers: sachin.dev, singh.amitesh
    
    Differential Revision: https://phab.enlightenment.org/D2390
---
 src/lib/elm_genlist.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 17fa6d3..92101fc 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -7693,16 +7693,17 @@ 
_elm_genlist_item_elm_interface_atspi_accessible_name_get(Eo *eo_it EINA_UNUSED,
 
         EINA_LIST_FREE(texts, key)
           {
-             char *s = it->itc->func.text_get
+             char *str_markup = it->itc->func.text_get
                 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
+             char *str_utf8 = _elm_util_mkup_to_text(str_markup);
 
-             s = _elm_util_mkup_to_text(s);
+             free(str_markup);
 
-             if (s)
+             if (str_utf8)
                {
                   if (eina_strbuf_length_get(buf) > 0) eina_strbuf_append(buf, 
", ");
-                  eina_strbuf_append(buf, s);
-                  free(s);
+                  eina_strbuf_append(buf, str_utf8);
+                  free(str_utf8);
                }
           }
      }

-- 


Reply via email to