Skip to content

Commit

Permalink
input: fix memory leak
Browse files Browse the repository at this point in the history
If kbd_queue is not empty and queue_count >= queue_limit,
we should free evt.

Change-Id: Ieeacf90d5e7e370a40452ec79031912d8b864d83
Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Message-id: 20171225023730.5512-1-linzhecheng@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit fca4774)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
cheney-lin authored and mdroth committed Feb 13, 2018
1 parent 88ab853 commit 30c3b48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ void qemu_input_event_send_key(QemuConsole *src, KeyValue *key, bool down)
} else if (queue_count < queue_limit) {
qemu_input_queue_event(&kbd_queue, src, evt);
qemu_input_queue_sync(&kbd_queue);
} else {
qapi_free_InputEvent(evt);
}
}

Expand Down

0 comments on commit 30c3b48

Please sign in to comment.