[gtk-vnc] Fix crash when no error is set after connection failure



commit a51e6a6973e9bdfcba0e52d3f9ee37686cd95db9
Author: Daniel P. Berrange <berrange redhat com>
Date:   Tue Apr 11 10:47:56 2017 +0100

    Fix crash when no error is set after connection failure
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 src/vncconnection.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 8cec1af..e5b43a0 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -5428,7 +5428,7 @@ static gboolean vnc_connection_open_addr_internal(VncConnection *conn)
         return TRUE;
     }
     vnc_connection_set_error(conn, "Unable to connect: %s",
-                             conn_error ? conn_error->message : "");
+                             conn_error ? conn_error->message : "Unknown problem");
     g_clear_error(&conn_error);
     return FALSE;
 }
@@ -5466,8 +5466,9 @@ static gboolean vnc_connection_open_host_internal(VncConnection *conn)
     }
     g_object_unref(enumerator);
     if (!sock) {
-        vnc_connection_set_error(conn, "Unable to connect: %s",
-                                 conn_error->message);
+        vnc_connection_set_error(conn, "Unable to connect to %s:%s: %s",
+                                 priv->host, priv->port,
+                                 conn_error ? conn_error->message : "Unknown problem");
     }
     g_clear_error(&conn_error);
     if (sock) {


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