[virt-tools-list] [virt-viewer 3/3] Deal with NULL gport in virt_viewer_app_set_connect_info()

Christophe Fergeau cfergeau at redhat.com
Thu Mar 12 16:54:08 UTC 2015


virt_viewer_app_set_connect_info() has a debug statement printing
gport/gtlsport. It checks that gtlsport is not NULL before printing it,
but makes no similar check for gport. Since it's possible to get a NULL
gport when using ovirt:// after the previous commit, it's better to check
it too.
---
 src/virt-viewer-app.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 1d462ca..2af1b93 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -2300,7 +2300,7 @@ virt_viewer_app_set_connect_info(VirtViewerApp *self,
     VirtViewerAppPrivate *priv = self->priv;
 
     g_debug("Set connect info: %s,%s,%s,%s,%s,%s,%s,%d",
-              host, ghost, gport, gtlsport ? gtlsport : "-1", transport, unixsock, user, port);
+              host, ghost, gport ? gport : "-1", gtlsport ? gtlsport : "-1", transport, unixsock, user, port);
 
     g_free(priv->host);
     g_free(priv->ghost);
-- 
2.1.0




More information about the virt-tools-list mailing list