efl_ui_textpath: fix potential memory leak 46/156646/4 accepted/tizen/4.0/unified/20171023.120327 submit/tizen_4.0/20171020.125844
authorSungtaek Hong <sth253.hong@samsung.com>
Thu, 19 Oct 2017 08:30:49 +0000 (17:30 +0900)
committerSungtaek Hong <sth253.hong@samsung.com>
Thu, 19 Oct 2017 09:45:33 +0000 (18:45 +0900)
Change-Id: I7a1b171354ff66bb87a75b38aaa4ea5decea7a6d
Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>
src/lib/efl_ui_textpath.c

index 85479f69346bcf5cb76b92dbf8a8ca070d0d141d..ff5b58258c48bb2cd3505d960904861c59e28a70 100644 (file)
@@ -415,12 +415,13 @@ _sizing_eval(Efl_Ui_Textpath_Data *pd)
 static void
 _textpath_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eina_Bool enabled)
 {
-   Eina_Strbuf *buf = eina_strbuf_new();
    const char *format;
 
    edje_object_part_text_style_user_pop(pd->text_obj, "elm.text");
    if (enabled)
      {
+        Eina_Strbuf *buf = eina_strbuf_new();
+
         eina_strbuf_append_printf(buf, "DEFAULT='ellipsis=1.0'");
         format = eina_stringshare_add(eina_strbuf_string_get(buf));
         eina_strbuf_free(buf);