From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mp5AQ-0000LC-IA for qemu-devel@nongnu.org; Sat, 19 Sep 2009 15:00:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mp5AM-0000KV-5c for qemu-devel@nongnu.org; Sat, 19 Sep 2009 15:00:18 -0400 Received: from [199.232.76.173] (port=42259 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mp5AL-0000KS-VZ for qemu-devel@nongnu.org; Sat, 19 Sep 2009 15:00:14 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:61020) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mp5AL-0004IJ-9H for qemu-devel@nongnu.org; Sat, 19 Sep 2009 15:00:13 -0400 From: Stefan Weil Date: Sat, 19 Sep 2009 21:00:09 +0200 Message-Id: <1253386809-15268-1-git-send-email-weil@mail.berlios.de> Subject: [Qemu-devel] [PATCH] vnc: Set invalid buffer pointers to NULL List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers 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 --- vnc.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/vnc.c b/vnc.c index 5eaef6a..433b514 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 */ -- 1.5.6.5