]> git.proxmox.com Git - mirror_qemu.git/commitdiff
input: fix memory leak
authorlinzhecheng <linzhecheng@huawei.com>
Mon, 25 Dec 2017 02:37:30 +0000 (10:37 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 13 Feb 2018 01:19:15 +0000 (19:19 -0600)
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>
ui/input.c

index 3e2d324278227f86082b9a9851a4ac1d1874081e..e5b78aae9ed99d1e21e3748d51687e66b4af81d8 100644 (file)
@@ -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);
     }
 }