mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-08 07:40:34 +00:00
vnc: remove a memory leak in zlib
Makes sure we free all ressources used in zlib encoding (zlib stream and buffer). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
5d418e3ba9
commit
161c4f20bf
@ -140,3 +140,11 @@ void vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
|
|||||||
vnc_write_u32(vs, bytes_written);
|
vnc_write_u32(vs, bytes_written);
|
||||||
vs->output.offset = new_offset;
|
vs->output.offset = new_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vnc_zlib_clear(VncState *vs)
|
||||||
|
{
|
||||||
|
if (vs->zlib_stream.opaque) {
|
||||||
|
deflateEnd(&vs->zlib_stream);
|
||||||
|
}
|
||||||
|
buffer_free(&vs->zlib);
|
||||||
|
}
|
||||||
|
2
vnc.c
2
vnc.c
@ -974,6 +974,8 @@ static void vnc_disconnect_finish(VncState *vs)
|
|||||||
|
|
||||||
qobject_decref(vs->info);
|
qobject_decref(vs->info);
|
||||||
|
|
||||||
|
vnc_zlib_clear(vs);
|
||||||
|
|
||||||
#ifdef CONFIG_VNC_TLS
|
#ifdef CONFIG_VNC_TLS
|
||||||
vnc_tls_client_cleanup(vs);
|
vnc_tls_client_cleanup(vs);
|
||||||
#endif /* CONFIG_VNC_TLS */
|
#endif /* CONFIG_VNC_TLS */
|
||||||
|
1
vnc.h
1
vnc.h
@ -405,5 +405,6 @@ void vnc_hextile_send_framebuffer_update(VncState *vs, int x,
|
|||||||
void vnc_hextile_set_pixel_conversion(VncState *vs, int generic);
|
void vnc_hextile_set_pixel_conversion(VncState *vs, int generic);
|
||||||
|
|
||||||
void vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
|
void vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
|
||||||
|
void vnc_zlib_clear(VncState *vs);
|
||||||
|
|
||||||
#endif /* __QEMU_VNC_H */
|
#endif /* __QEMU_VNC_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user