From 14bcd31ef43870b955ac32db488ee71afb4176e2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 14 Oct 2012 23:45:41 +0200 Subject: [PATCH] input: fix memory leak with full key buffer mp_input_feed_key() didn't free the command if it was discarded due to the queue exceeding its maximum size. Fix. --- input/input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input/input.c b/input/input.c index a7058b218d..292a8eb9f4 100644 --- a/input/input.c +++ b/input/input.c @@ -1135,8 +1135,10 @@ void mp_input_feed_key(struct input_ctx *ictx, int code) return; struct cmd_queue *queue = &ictx->key_cmd_queue; if (queue->num_cmds >= ictx->key_fifo_size && - (!is_abort_cmd(cmd->id) || queue->num_abort_cmds)) + (!is_abort_cmd(cmd->id) || queue->num_abort_cmds)) { + talloc_free(cmd); return; + } queue_add(queue, cmd, false); } -- 2.11.4.GIT