diff options
author | Thomas Haller <thaller@redhat.com> | 2019-01-22 23:17:50 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-02-05 08:34:23 +0100 |
commit | 883978ec99d18b35d85dc6964da1bf74692c55a5 (patch) | |
tree | 1ac78ba713424cc13b713fbff536d9809cf3ae61 | |
parent | d52fd81b919917d43504385dcfcb04d8c15049ec (diff) | |
download | NetworkManager-883978ec99d18b35d85dc6964da1bf74692c55a5.tar.gz |
clients/secret-agent: use g_hash_table_get_keys_as_array() in nm_secret_agent_simple_enable()
-rw-r--r-- | clients/common/nm-secret-agent-simple.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 5a36dffa7a..eab11841a6 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -1090,7 +1090,8 @@ void nm_secret_agent_simple_enable (NMSecretAgentSimple *self, const char *path) { NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self); - GList *requests, *iter; + gs_free RequestData **requests = NULL; + gsize i; gs_free char *path_full = NULL; /* The path is only used to match a request_id with the current @@ -1109,11 +1110,9 @@ nm_secret_agent_simple_enable (NMSecretAgentSimple *self, const char *path) priv->enabled = TRUE; /* Service pending secret requests. */ - requests = g_hash_table_get_values (priv->requests); - for (iter = requests; iter; iter = g_list_next (iter)) - request_secrets_from_ui (iter->data); - - g_list_free (requests); + requests = (RequestData **) g_hash_table_get_keys_as_array (priv->requests, NULL); + for (i = 0; requests[i]; i++) + request_secrets_from_ui (requests[i]); } /*****************************************************************************/ |