Return if xmlParseURI() failed, instead of crashing

This commit is contained in:
Marc-André Lureau 2011-07-19 19:32:51 +02:00 committed by Daniel P. Berrange
parent 1002a220a4
commit f08c5308ca

View File

@ -88,6 +88,8 @@ virt_viewer_util_extract_host(const char *uristr,
uristr = "xen:///";
uri = xmlParseURI(uristr);
g_return_val_if_fail(uri != NULL, 1);
if (host) {
if (!uri || !uri->server)
*host = g_strdup("localhost");