diff options
author | linzhecheng <linzhecheng@huawei.com> | 2017-12-25 10:37:30 +0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-01-12 14:20:39 +0100 |
commit | fca4774a96843ba9d32a5d5d1c3826e1478facae (patch) | |
tree | 67a6f460fdca8c11955268dc2add0233864fbdf7 /ui/input.c | |
parent | 997eba28a3ed5400a80f754bf3a1c8044b75b9ff (diff) | |
download | qemu-fca4774a96843ba9d32a5d5d1c3826e1478facae.zip qemu-fca4774a96843ba9d32a5d5d1c3826e1478facae.tar.gz qemu-fca4774a96843ba9d32a5d5d1c3826e1478facae.tar.bz2 |
input: fix memory leak
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>
Diffstat (limited to 'ui/input.c')
-rw-r--r-- | ui/input.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); } } |