[gtk-vnc] Reset xmit_buffer fields to fix reconnect
- From: Daniel P. Berrange <dberrange src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-vnc] Reset xmit_buffer fields to fix reconnect
- Date: Mon, 16 Aug 2010 20:17:55 +0000 (UTC)
commit 55d0ee7ba77e15ac5bcf59ff6160170d5b67784f
Author: Daniel P. Berrange <dan berrange com>
Date: Sun Aug 15 18:30:19 2010 +0100
Reset xmit_buffer fields to fix reconnect
If a vnc_connection object was closed and reopened old data
in the xmit_buffer fields would cause a crash, since it was
not re-initialized
src/vncconnection.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 195200d..7525b8d 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -4201,7 +4201,12 @@ static void vnc_connection_close(VncConnection *conn)
priv->name = NULL;
}
- g_free (priv->xmit_buffer);
+ if (priv->xmit_buffer) {
+ g_free(priv->xmit_buffer);
+ priv->xmit_buffer = NULL;
+ priv->xmit_buffer_size = 0;
+ priv->xmit_buffer_capacity = 0;
+ }
if (priv->cred_username) {
g_free(priv->cred_username);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]