entry: fix memory leak issue for atspi 28/153428/2
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 28 Sep 2017 10:13:05 +0000 (19:13 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 28 Sep 2017 10:30:43 +0000 (10:30 +0000)
@tizne_fix

Change-Id: Ib7820537a74b504939c78848b03cf5f644e49970

src/lib/elm_entry.c

index a37ca84..4d2f7f9 100644 (file)
@@ -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
                     {