connectivity: fix crash when the uri gets cleared from configuration

host_and_port_from_uri() crashes if the new uri is NULL.

Fixes: 2cec94bacc

https://bugzilla.redhat.com/show_bug.cgi?id=1634500
This commit is contained in:
Beniamino Galvani 2018-10-01 09:40:14 +02:00
parent b595232021
commit 871cd6128d

View file

@ -892,7 +892,8 @@ update_config (NMConnectivity *self, NMConfigData *config_data)
g_clear_pointer (&priv->host, g_free);
g_clear_pointer (&priv->port, g_free);
host_and_port_from_uri (uri, &priv->host, &priv->port);
if (uri)
host_and_port_from_uri (uri, &priv->host, &priv->port);
}
/* Set the interval. */