summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-10-01 09:40:14 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2018-10-01 09:46:14 +0200
commit871cd6128dd99c707ee6062c52da419a2a0fae65 (patch)
tree424751844ea237a04e99e3d326c7146198a928eb
parentb595232021fc71114b94477242d0414abf6fc9d5 (diff)
downloadNetworkManager-871cd6128dd99c707ee6062c52da419a2a0fae65.tar.gz
connectivity: fix crash when the uri gets cleared from configuration
host_and_port_from_uri() crashes if the new uri is NULL. Fixes: 2cec94bacce4a09c0e5ffa241b8d50fd4702dddc https://bugzilla.redhat.com/show_bug.cgi?id=1634500
-rw-r--r--src/nm-connectivity.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
index ab0ef56597..e74d6f103d 100644
--- a/src/nm-connectivity.c
+++ b/src/nm-connectivity.c
@@ -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. */