Fix memory leak
[platform/core/uifw/inputdelegator.git] / 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;