Fix memory leak 36/165936/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 5 Jan 2018 00:31:16 +0000 (09:31 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 5 Jan 2018 02:23:47 +0000 (11:23 +0900)
Change-Id: I2ec22d8fcd6e48c9207cb4c7e8c41f5c9b8ef9d4
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/w-input-keyboard.cpp

index 0d7afa8..5e9ae09 100755 (executable)
@@ -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;