hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=135af1a13ff8fbc706f302a79e6472994a20ef8f

commit 135af1a13ff8fbc706f302a79e6472994a20ef8f
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Mon Mar 7 22:41:31 2016 +0900

    console: free memory after used it.
---
 src/bin/console.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/bin/console.c b/src/bin/console.c
index 92c1184..29e7b33 100644
--- a/src/bin/console.c
+++ b/src/bin/console.c
@@ -39,7 +39,7 @@ error_word_select(Evas_Object *console)
 
     //find error word position
     const char *entry_text = enventor_object_text_get(base_enventor_get());
-    const char *utf8 = elm_entry_markup_to_utf8(entry_text);
+    char *utf8 = elm_entry_markup_to_utf8(entry_text);
 
     enventor_object_line_goto(base_enventor_get(), atoi(error_line));
     int pos = enventor_object_cursor_pos_get(base_enventor_get());
@@ -48,12 +48,17 @@ error_word_select(Evas_Object *console)
     const char *matched = strstr(search_line, error_word);
 
     if (matched == NULL)
-      return;
+      {
+         free(utf8);
+         return;
+      }
 
     int start, end;
     start = matched - utf8;
     end = start + strlen(error_word);
 
+    free(utf8);
+
     //select error word
     enventor_object_select_region_set(base_enventor_get(), start, end);
 }

-- 


Reply via email to