Message ID | 20171225023730.5512-1-linzhecheng@huawei.com |
---|---|
State | New |
Headers | show |
Series | input: fix memory leak | expand |
On Mon, Dec 25, 2017 at 10:37:30AM +0800, linzhecheng wrote: > 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> Patch added to queue. thanks, Gerd
diff --git a/ui/input.c b/ui/input.c index 3e2d324278..e5b78aae9e 100644 --- a/ui/input.c +++ b/ui/input.c @@ -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); } }
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>