hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=79f10753fe2ff01343ed3916b42f5656b7592855

commit 79f10753fe2ff01343ed3916b42f5656b7592855
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Mon Mar 7 22:55:34 2016 +0900

    edc_editor: one more memory leak :(
---
 src/lib/edc_editor.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index 35c4ef4..0fd966c 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -513,7 +513,7 @@ ctxpopup_candidate_changed_cb(void *data, Evas_Object *obj 
EINA_UNUSED,
 {
    edit_data *ed = data;
    const char *text = event_info;
-   char *ch;
+   char *ch = NULL;
    int cur_pos, end_pos;
    int i;
    cur_pos = elm_entry_cursor_pos_get(ed->en_edit);
@@ -521,16 +521,18 @@ ctxpopup_candidate_changed_cb(void *data, Evas_Object 
*obj EINA_UNUSED,
    end_pos = elm_entry_cursor_pos_get(ed->en_edit);
 
    for (i = cur_pos; i <= end_pos; i++)
-   {
-      elm_entry_cursor_pos_set(ed->en_edit, i);
-      ch = elm_entry_cursor_content_get(ed->en_edit);
-      if (!strcmp(ch, ";"))
-        {
-           //1 more space for end_pos to replace until ';'.
-           end_pos = elm_entry_cursor_pos_get(ed->en_edit) + 1;
-           break;
-        }
-   }
+     {
+        elm_entry_cursor_pos_set(ed->en_edit, i);
+        ch = elm_entry_cursor_content_get(ed->en_edit);
+        if (!strcmp(ch, ";"))
+          {
+             //1 more space for end_pos to replace until ';'.
+             end_pos = elm_entry_cursor_pos_get(ed->en_edit) + 1;
+             free(ch);
+             break;
+          }
+        free(ch);
+     }
 
    elm_entry_select_region_set(ed->en_edit, cur_pos, end_pos);
 

-- 


Reply via email to