Fix memory leak of elm_entry_markup_to_utf8() 17/320517/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 4 Mar 2025 11:44:48 +0000 (20:44 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 4 Mar 2025 11:44:48 +0000 (20:44 +0900)
Change-Id: Ib0a032ff6f6726de6443ca416d9f53e9f2940b72
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/w-input-keyboard.cpp

index 95903b396aa15d18582b696b1f6b6bae8e168b6d..39c186da18b4e4f67bcdec936732619333066884 100644 (file)
@@ -225,7 +225,7 @@ void exit_keyboard()
                return;
        }
 
-       const char *getText = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+       char *getText = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
        SECURE_LOGD("button key clicked!! : getText = %s", getText);
 
        char cursorPosition[512];
@@ -239,6 +239,7 @@ void exit_keyboard()
        set_source_caller_app_id(app_control);
        free(app_id);
        reply_to_sender_by_callback(getText, "keyboard", NULL, cursorPosition);
+       free(getText);
        app_control_destroy(app_control);
        ui_app_exit();
 }