qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT fa0cfdf] vnc: Set invalid buffer pointers to NULL


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT fa0cfdf] vnc: Set invalid buffer pointers to NULL
Date: Mon, 05 Oct 2009 14:53:34 -0000

From: Stefan Weil <address@hidden>

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 <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/vnc.c b/vnc.c
index 592c9b3..42c92ed 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 */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]