Skip to content

Commit

Permalink
vnc: fix a memory leak in threaded vnc server
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
iksaif authored and Anthony Liguori committed Feb 25, 2011
1 parent 30faaf7 commit c53af37
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/vnc-jobs-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c53af37

Please sign in to comment.