gengrid: fix mem leak occuring when getting name from atspi interface

This commit is contained in:
Lukasz Stanislawski 2015-05-04 11:45:06 +02:00
parent b25a0a3ea3
commit f299be8712
1 changed files with 7 additions and 5 deletions

View File

@ -4956,17 +4956,19 @@ _elm_gengrid_item_elm_interface_atspi_accessible_name_get(Eo *eo_it EINA_UNUSED,
EINA_LIST_FREE(texts, key) 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); ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
s = _elm_util_mkup_to_text(s); char *str_utf8 = _elm_util_mkup_to_text(str_markup);
if (s) free(str_markup);
if (str_utf8)
{ {
if (eina_strbuf_length_get(buf) > 0) if (eina_strbuf_length_get(buf) > 0)
eina_strbuf_append(buf, ", "); eina_strbuf_append(buf, ", ");
eina_strbuf_append(buf, s); eina_strbuf_append(buf, str_utf8);
free(s); free(str_utf8);
} }
} }
} }