input_manager: fix potential memory leak on text
Fix potential memory leak when controller_push_event failed.
@@ -144,6 +144,7 @@ void input_manager_process_text_input(struct input_manager *input_manager,
return;
}
if (!controller_push_event(input_manager->controller, &control_event)) {
+ SDL_free(control_event.text_event.text);
LOGW("Cannot send text event");
}
}
