[gtk-vnc] Fix crash when opening connection from a GSocketAddress



commit 5368f77d6215d7b6ad1422dff284d288a26ff481
Author: Daniel P. Berrange <berrange redhat com>
Date:   Thu Apr 6 17:24:50 2017 +0100

    Fix crash when opening connection from a GSocketAddress
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 src/vncconnection.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index c55f71d..8cec1af 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -5423,13 +5423,13 @@ static gboolean vnc_connection_open_addr_internal(VncConnection *conn)
     VNC_DEBUG("Connecting with addr %p", priv->addr);
 
     sock = vnc_connection_connect_socket(&priv->wait, priv->addr, &conn_error);
-    vnc_connection_set_error(conn, "Unable to connect: %s",
-                             conn_error->message);
-    g_clear_error(&conn_error);
     if (sock) {
         priv->sock = sock;
         return TRUE;
     }
+    vnc_connection_set_error(conn, "Unable to connect: %s",
+                             conn_error ? conn_error->message : "");
+    g_clear_error(&conn_error);
     return FALSE;
 }
 


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