qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server
       [not found] <D6799E202000048000AA8EC@novprvoes0310.provo.novell.com>
@ 2011-02-25 21:54 ` Corentin Chary
  2011-02-25 22:50   ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Corentin Chary @ 2011-02-25 21:54 UTC (permalink / raw)
  To: Bruce Rogers
  Cc: Corentin Chary, Stefan Hajnoczi, Alexander Graf, qemu-devel,
	Blue Swirl, Anthony Liguori, Torsten Förtsch

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 <corentincj@iksaif.net>
---
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)
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server
  2011-02-25 21:54 ` [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server Corentin Chary
@ 2011-02-25 22:50   ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2011-02-25 22:50 UTC (permalink / raw)
  To: Corentin Chary
  Cc: Bruce Rogers, Stefan Hajnoczi, qemu-devel, Alexander Graf,
	Blue Swirl, Torsten Förtsch

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<corentincj@iksaif.net>
>    

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)
>    

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-25 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <D6799E202000048000AA8EC@novprvoes0310.provo.novell.com>
2011-02-25 21:54 ` [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server Corentin Chary
2011-02-25 22:50   ` Anthony Liguori

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).