diff options
author | linzhecheng <linzhecheng@huawei.com> | 2017-12-25 10:37:30 +0800 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2018-02-12 19:19:15 -0600 |
commit | 30c3b4823c34a7410ec86c8e8b42db56b7b11117 (patch) | |
tree | 1f340ec0980b31b82a07fe1eab6564e0ffa2ccaa | |
parent | 88ab85384da431950d319ab69438891c29e4a5dd (diff) | |
download | qemu-30c3b4823c34a7410ec86c8e8b42db56b7b11117.zip qemu-30c3b4823c34a7410ec86c8e8b42db56b7b11117.tar.gz qemu-30c3b4823c34a7410ec86c8e8b42db56b7b11117.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>
(cherry picked from commit fca4774a96843ba9d32a5d5d1c3826e1478facae)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-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); } } |