提交 fa0cfdf2 编写于 作者: S Stefan Weil 提交者: Anthony Liguori

vnc: Set invalid buffer pointers to NULL

After qemu_free, the pointers for input and output
buffers are no longer valid, so set them to NULL
(most other calls of qemu_free in vnc.c use this
pattern, too).
Signed-off-by: NStefan Weil <weil@mail.berlios.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 7f1e9d4e
......@@ -894,8 +894,14 @@ static void vnc_disconnect_start(VncState *vs)
static void vnc_disconnect_finish(VncState *vs)
{
if (vs->input.buffer) qemu_free(vs->input.buffer);
if (vs->output.buffer) qemu_free(vs->output.buffer);
if (vs->input.buffer) {
qemu_free(vs->input.buffer);
vs->input.buffer = NULL;
}
if (vs->output.buffer) {
qemu_free(vs->output.buffer);
vs->output.buffer = NULL;
}
#ifdef CONFIG_VNC_TLS
vnc_tls_client_cleanup(vs);
#endif /* CONFIG_VNC_TLS */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册