summaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2009-09-19 21:00:09 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:52 -0500
commitfa0cfdf24a75f3e6aa6c8b6efcbebd09e7f054aa (patch)
tree554a8ce3a88f8a58354fdf00667509045192d94f /vnc.c
parent7f1e9d4e138f5baf1e862a1221ba13eee7dcce9e (diff)
downloadqemu-fa0cfdf24a75f3e6aa6c8b6efcbebd09e7f054aa.tar.gz
qemu-fa0cfdf24a75f3e6aa6c8b6efcbebd09e7f054aa.tar.bz2
qemu-fa0cfdf24a75f3e6aa6c8b6efcbebd09e7f054aa.zip
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: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/vnc.c b/vnc.c
index 592c9b3987..42c92ed36b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -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 */