* [Qemu-devel] [PATCH] input: fix memory leak
@ 2017-12-25 2:37 linzhecheng
2018-01-12 13:21 ` Gerd Hoffmann
0 siblings, 1 reply; 2+ messages in thread
From: linzhecheng @ 2017-12-25 2:37 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, arei.gonglei, linzhecheng
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>
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);
}
}
--
2.12.2.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] input: fix memory leak
2017-12-25 2:37 [Qemu-devel] [PATCH] input: fix memory leak linzhecheng
@ 2018-01-12 13:21 ` Gerd Hoffmann
0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2018-01-12 13:21 UTC (permalink / raw)
To: linzhecheng; +Cc: qemu-devel, arei.gonglei
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-12 13:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-25 2:37 [Qemu-devel] [PATCH] input: fix memory leak linzhecheng
2018-01-12 13:21 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).