1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 15:22:09 +00: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:
wm4 2012-10-14 23:45:41 +02:00
parent 73b44b44a4
commit f2e662fe3f

View File

@ -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);
}