From: Youngbok Shin Date: Thu, 28 Sep 2017 10:13:05 +0000 (+0900) Subject: entry: fix memory leak issue for atspi X-Git-Tag: submit/tizen/20171012.123430~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e8d18be4692002cbaf04fbc7f0b47dd90b375ef;p=platform%2Fupstream%2Felementary.git entry: fix memory leak issue for atspi @tizne_fix Change-Id: Ib7820537a74b504939c78848b03cf5f644e49970 --- diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index a37ca84d0..4d2f7f9e8 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -8228,10 +8228,10 @@ _atspi_expose_anchors(Eo *obj, Eina_Bool is_atspi) { Evas_Object *rect = NULL; Evas_Object *ao = NULL; - const char *text; + char *text; evas_textblock_cursor_at_format_set(end, node); - text = (const char *)evas_textblock_cursor_range_text_get( + text = evas_textblock_cursor_range_text_get( start, end, EVAS_TEXTBLOCK_TEXT_PLAIN); range = evas_textblock_cursor_range_geometry_get(start, end); @@ -8249,7 +8249,7 @@ _atspi_expose_anchors(Eo *obj, Eina_Bool is_atspi) eina_list_append(sd->anchor_atspi_rects, rect); ao = elm_access_object_register(rect, obj); - elm_atspi_accessible_name_set(ao, text); + elm_atspi_accessible_name_set(ao, (const char *)text); elm_atspi_accessible_reading_info_type_set(ao, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); evas_object_smart_callback_add(ao, "atspi,highlighted", @@ -8265,6 +8265,8 @@ _atspi_expose_anchors(Eo *obj, Eina_Bool is_atspi) free(r); range = eina_list_remove_list(range, ll); } + + if (text) free(text); } else {