[gtk-vnc] Fix crash in server cut text



commit f8df0582975fa6ecf3399cae54a4cf617139a3e8
Author: Daniel P. Berrange <dan berrange com>
Date:   Wed Jun 16 22:44:11 2010 +0100

    Fix crash in server cut text
    
    GString needs to be freed with g_string_free rather than g_free.
    Fix the signature of the cut text callback

 src/vncconnection.c |    2 +-
 src/vncdisplay.c    |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 85bbe92..7861903 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -2369,7 +2369,7 @@ static void vnc_connection_server_cut_text(VncConnection *conn,
 
 	vnc_connection_emit_main_context(conn, VNC_SERVER_CUT_TEXT, &sigdata);
 
-	g_free(text);
+	g_string_free(text, TRUE);
 }
 
 static void vnc_connection_resize(VncConnection *conn, int width, int height)
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 3559a9f..4268b78 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1141,7 +1141,9 @@ static void on_auth_unsupported(VncConnection *conn G_GNUC_UNUSED,
 	g_signal_emit(G_OBJECT(obj), signals[VNC_AUTH_UNSUPPORTED], 0, authType);
 }
 
-static void on_server_cut_text(void *opaque, const gchar *text)
+static void on_server_cut_text(VncConnection *conn G_GNUC_UNUSED,
+			       const gchar *text,
+			       gpointer opaque)
 {
 	VncDisplay *obj = VNC_DISPLAY(opaque);
 



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