diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-04-17 16:17:40 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-04-17 16:22:34 +0200 |
commit | 0fa57069ad98e9f2d98b93aba6a41cadd095b284 (patch) | |
tree | 772675273c772e6cb45920cd586b1ebb491a8825 /src/nm-auth-manager.c | |
parent | cbeabaa00011ace3c6893427511eb36abee3d5a4 (diff) | |
download | NetworkManager-0fa57069ad98e9f2d98b93aba6a41cadd095b284.tar.gz |
auth-manager: fix processing calls in _dbus_new_proxy_cb()
In the first loop, the element is removed only when the callback is
executed. The second loop never removes the current element. Use the
for_each macro for both.
Fixes: d0563f0733ed293d67e9a0f6503e28c3f1c08f1b
Diffstat (limited to 'src/nm-auth-manager.c')
-rw-r--r-- | src/nm-auth-manager.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nm-auth-manager.c b/src/nm-auth-manager.c index 29fbf6e468..7a9fcbfa4f 100644 --- a/src/nm-auth-manager.c +++ b/src/nm-auth-manager.c @@ -500,7 +500,7 @@ _dbus_new_proxy_cb (GObject *source_object, NMAuthManagerPrivate *priv; gs_free GError *error = NULL; GDBusProxy *proxy; - NMAuthManagerCallId *call_id; + NMAuthManagerCallId *call_id, *safe; proxy = g_dbus_proxy_new_for_bus_finish (res, &error); @@ -516,7 +516,7 @@ _dbus_new_proxy_cb (GObject *source_object, if (!priv->proxy) { _LOGE ("could not create polkit proxy: %s", error->message); - while ((call_id = c_list_first_entry (&priv->calls_lst_head, NMAuthManagerCallId, calls_lst))) { + c_list_for_each_entry_safe (call_id, safe, &priv->calls_lst_head, calls_lst) { if (call_id->dbus_parameters) { _LOG2T (call_id, "completed: failed due to no D-Bus proxy after startup"); _call_id_invoke_callback (call_id, FALSE, FALSE, error); @@ -537,7 +537,7 @@ _dbus_new_proxy_cb (GObject *source_object, _log_name_owner (self, NULL); - while ((call_id = c_list_first_entry (&priv->calls_lst_head, NMAuthManagerCallId, calls_lst))) { + c_list_for_each_entry (call_id, &priv->calls_lst_head, calls_lst) { if (call_id->dbus_parameters) { _LOG2T (call_id, "CheckAuthorization invoke now"); _call_check_authorize (call_id); |