mirror of
https://github.com/mpv-player/mpv
synced 2024-08-24 07:21:49 +02:00
input: fix mp_cmd memory leak
mp_input_feed_key() didn't free the command, if it was discarded due to the queue exceeding its maximum size.
This commit is contained in:
parent
73b44b44a4
commit
f2e662fe3f
@ -1362,7 +1362,10 @@ void mp_input_feed_key(struct input_ctx *ictx, int code)
|
||||
struct cmd_queue *queue = &ictx->key_cmd_queue;
|
||||
if (queue_count_cmds(queue) >= ictx->key_fifo_size &&
|
||||
(!mp_input_is_abort_cmd(cmd->id) || queue_has_abort_cmds(queue)))
|
||||
{
|
||||
talloc_free(cmd);
|
||||
return;
|
||||
}
|
||||
queue_add(queue, cmd, false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user