diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-06-01 10:02:36 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-06-01 10:26:01 +0200 |
commit | a1f1b13f4fa508cd94c641fd3e0ec0b9836b01b5 (patch) | |
tree | 2aa8519032372ed14031033e7b279f2888d90953 | |
parent | bc28a2b1641c2edadbddd30070f10c920301c190 (diff) | |
download | NetworkManager-a1f1b13f4fa508cd94c641fd3e0ec0b9836b01b5.tar.gz |
settings: fix plugins loading
Since load_plugin() modifies the list, we must pass its address.
Fixes: fd86a1aebbcdbfd9854ca5f9755e8e2fe90e5f1d
-rw-r--r-- | src/settings/nm-settings.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 9401873410..6ad2624df4 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -653,7 +653,7 @@ plugin_loaded (GSList *list, const char *path) } static gboolean -load_plugin (NMSettings *self, GSList *list, const char *pname, GError **error) +load_plugin (NMSettings *self, GSList **list, const char *pname, GError **error) { gs_free char *full_name = NULL; gs_free char *path = NULL; @@ -666,7 +666,7 @@ load_plugin (NMSettings *self, GSList *list, const char *pname, GError **error) full_name = g_strdup_printf ("nm-settings-plugin-%s", pname); path = g_module_build_path (NMPLUGINDIR, full_name); - if (plugin_loaded (list, path)) + if (plugin_loaded (*list, path)) return TRUE; if (stat (path, &st) != 0) { @@ -719,7 +719,7 @@ load_plugin (NMSettings *self, GSList *list, const char *pname, GError **error) g_object_set_qdata_full (obj, plugin_module_path_quark (), path, g_free); path = NULL; if (add_plugin (self, NM_SETTINGS_PLUGIN (obj))) - list = g_slist_append (list, g_steal_pointer (&obj)); + *list = g_slist_append (*list, g_steal_pointer (&obj)); return TRUE; } @@ -787,7 +787,7 @@ load_plugins (NMSettings *self, const char **plugins, GError **error) continue; } - success = load_plugin (self, list, pname, error); + success = load_plugin (self, &list, pname, error); if (!success) break; @@ -797,7 +797,7 @@ load_plugins (NMSettings *self, const char **plugins, GError **error) pname = "ibft"; add_ibft = FALSE; - success = load_plugin (self, list, "ibft", error); + success = load_plugin (self, &list, "ibft", error); if (!success) break; } |