From dee641600f7598dbc911d867d515a9d75090d574 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Jan 2018 09:31:16 +0900 Subject: [PATCH] Fix memory leak Change-Id: I2ec22d8fcd6e48c9207cb4c7e8c41f5c9b8ef9d4 Signed-off-by: Jihoon Kim --- src/w-input-keyboard.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 0d7afa8..5e9ae09 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -36,7 +36,7 @@ bool input_keyboard_init(app_control_h app_control) char *guide_text = NULL; char *return_key_type = _("IDS_AMEMO_BUTTON_SEND"); char *max_text_length = NULL; - char *cursor_position_set = (char *)"0"; + char *cursor_position_set = NULL; input_keyboard_deinit(); @@ -55,10 +55,12 @@ bool input_keyboard_init(app_control_h app_control) ret = app_control_get_extra_data(app_control, "max_text_length", &max_text_length); if (ret == APP_CONTROL_ERROR_NONE) { g_input_keyboard_data.max_text_length = atoi(max_text_length); + free(max_text_length); } ret = app_control_get_extra_data(app_control, "cursor_position_set", &cursor_position_set); if (ret == APP_CONTROL_ERROR_NONE) { g_input_keyboard_data.cursor_position_set = atoi(cursor_position_set); + free(cursor_position_set); } return true; -- 2.7.4