mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06: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
3 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
vs->output.offset = new_offset;
|
||||
}
|
||||
|
||||
void vnc_zlib_clear(VncState *vs)
|
||||
{
|
||||
if (vs->zlib_stream.opaque) {
|
||||
deflateEnd(&vs->zlib_stream);
|
||||
}
|
||||
buffer_free(&vs->zlib);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue