Skip to content

Commit 0ae0b06

Browse files
Lekensteynkraxel
authored andcommitted
vnc: fix memleak of the "vnc-worker-output" name
Fixes repeated memory leaks of 18 bytes when using VNC: Direct leak of 831024 byte(s) in 46168 object(s) allocated from: ... #4 0x7f6d2f919bdd in g_strdup_vprintf glib/gstrfuncs.c:514 #5 0x56085cdcf660 in buffer_init util/buffer.c:59 #6 0x56085ca6a7ec in vnc_async_encoding_start ui/vnc-jobs.c:177 #7 0x56085ca6b815 in vnc_worker_thread_loop ui/vnc-jobs.c:240 Fixes: 543b958 ("vnc: attach names to buffers") Cc: Gerd Hoffmann <[email protected]> CC: [email protected] Signed-off-by: Peter Wu <[email protected]> Reviewed-by: Marc-André Lureau <[email protected]> Message-id: [email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent 2313e48 commit 0ae0b06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/vnc-jobs.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static void vnc_async_encoding_start(VncState *orig, VncState *local)
193193

194194
static void vnc_async_encoding_end(VncState *orig, VncState *local)
195195
{
196+
buffer_free(&local->output);
196197
orig->tight = local->tight;
197198
orig->zlib = local->zlib;
198199
orig->hextile = local->hextile;
@@ -278,7 +279,7 @@ static int vnc_worker_thread_loop(VncJobQueue *queue)
278279
/* Copy persistent encoding data */
279280
vnc_async_encoding_end(job->vs, &vs);
280281

281-
qemu_bh_schedule(job->vs->bh);
282+
qemu_bh_schedule(job->vs->bh);
282283
} else {
283284
buffer_reset(&vs.output);
284285
/* Copy persistent encoding data */

0 commit comments

Comments
 (0)