[qemu-xen master] input: fix memory leak

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[qemu-xen master] input: fix memory leak

patchbot
commit 30c3b4823c34a7410ec86c8e8b42db56b7b11117
Author:     linzhecheng <[hidden email]>
AuthorDate: Mon Dec 25 10:37:30 2017 +0800
Commit:     Michael Roth <[hidden email]>
CommitDate: Mon Feb 12 19:19:15 2018 -0600

    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 <[hidden email]>
    Message-id: [hidden email]
    Signed-off-by: Gerd Hoffmann <[hidden email]>
    (cherry picked from commit fca4774a96843ba9d32a5d5d1c3826e1478facae)
    Signed-off-by: Michael Roth <[hidden email]>
---
 ui/input.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ui/input.c b/ui/input.c
index 3e2d324..e5b78aa 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);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog