settings: fix unrefing setting is there are no plugins loaded

This wasn't a problem, because load_plugins() can only fails
if the settings plugins fail to load, which can only happen
if you have a broken installation.
This commit is contained in:
Thomas Haller 2018-03-29 10:30:49 +02:00
parent 8c56c47bba
commit 213323a6a7

View file

@ -1847,10 +1847,8 @@ nm_settings_start (NMSettings *self, GError **error)
/* Load the plugins; fail if a plugin is not found. */
plugins = nm_config_data_get_plugins (nm_config_get_data_orig (priv->config), TRUE);
if (!load_plugins (self, (const char **) plugins, error)) {
g_object_unref (self);
if (!load_plugins (self, (const char **) plugins, error))
return FALSE;
}
load_connections (self);
check_startup_complete (self);