mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 21:44:20 +01:00
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:
@@ -144,6 +144,7 @@ void input_manager_process_text_input(struct input_manager *input_manager,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!controller_push_event(input_manager->controller, &control_event)) {
|
if (!controller_push_event(input_manager->controller, &control_event)) {
|
||||||
|
SDL_free(control_event.text_event.text);
|
||||||
LOGW("Cannot send text event");
|
LOGW("Cannot send text event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user