qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server
Date: Fri, 25 Feb 2011 16:50:04 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

On 02/25/2011 03:54 PM, Corentin Chary wrote:
VncJobQueue's buffer is intended to be used for
as the output buffer for all operations in this queue,
but unfortunatly.

vnc_async_encoding_start() is in charge of setting this
buffer as the current output buffer, but
vnc_async_encoding_end() was not writting the changes back
to VncJobQueue, resulting in a big and ugly memleak.

Signed-off-by: Corentin Chary<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

---
I believe this is a (slightly) better patch than Bruce's one, because
it reduce memory allocations by using always the same buffer.

  ui/vnc-jobs-async.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
index 1d4c5e7..f596247 100644
--- a/ui/vnc-jobs-async.c
+++ b/ui/vnc-jobs-async.c
@@ -186,6 +186,8 @@ static void vnc_async_encoding_end(VncState *orig, VncState 
*local)
      orig->hextile = local->hextile;
      orig->zrle = local->zrle;
      orig->lossy_rect = local->lossy_rect;
+
+    queue->buffer = local->output;
  }

  static int vnc_worker_thread_loop(VncJobQueue *queue)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]