input_manager: fix potential memory leak on text
Fix potential memory leak when controller_push_event failed. Signed-off-by: yuchenlin <npes87184@gmail.com>
This commit is contained in:
parent
0b92b93358
commit
96056e3213
1 changed files with 1 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue